Monday, 30 June 2014

SharePoint Interview Questions

1.  SharePoint:

1) Microsoft SharePoint is an enterprise collaboration and content management platform,. SharePoint is a business collaboration platform.
2) SharePoint 2010 is a platform where user can share Data, Collaborate and people can also take this platform and customized patform as per their requirements.
3) SPFarm -> SPServer -> SPServices -   >SPWebServices  ->SPWebApplication  ->SPSite Collection
                                                -> SPWeb  ->SPList  ->SPField  ->SPItem ->SPFile ->SPFolder
4) SharePoint having one of the best feature is SharePoint Designer, InfoPath, search services.
  5). SharePoint is web Application platform developed by Microsoft.

2.  SharePoint 2010 Features:

 1) Sites: A site is a contextual work environment. Once SharePoint is configured, these sites can be created without any requirement for specialized knowledge. A context for a site may be organization-wide, or it may be specific to an individual team or group.
2) Communities: A community is a place where communication and understanding happens. Communities can occur around any context, and will typically develop around either shared knowledge, or shared activities (such as collaboration).
3)Content: SharePoint provides management of documents and work items that need to be stored, found, collaborated on, updated, managed, documented, archived, traced or restored - in accordance with relevant compliance or governance policies.
4) Search: Look for relevant communities, content, people, or sites: search is based on keywords, refinement, and content analysis.
5) Insights: Information from any part of the organization can be surfaced inside useful contexts, providing information that can improve effectiveness.
6) Composites: SharePoint enables no-code integration of data, documents and processes to provide composite applications ("mash-ups" based on internal data).

3.     Different between SharePoint  2010  vs  SharePoint  2013
               
SharePoint 2013 is new version of famous collaboration portal.
SharePoint 2013 the new versions adds few existing features such as Social Feed, SharePoint apps and Cross site publishing.

sharepoint 2010 was released in 2010.

Application:
 However the sandbox solution could be deprecated and replaced the application model.
  introduce App Catalog&Marketplace
Collaboration:
Improving the Team-sites , Work-management in 2013
Social:
  introduce the Newsfeed,Skydrive Pro, Community Sites  Follow Content , Follow  site, Follow User .
Search:
   introduce Out-of-Box FastSearch , Continuos Crawl.
Content Mnagement:
  introduce Cross-site-Publishing,eDiscovery
BI:
 Same as well as SharePoint 2010 and 2013
Busniess Solutions:
 introduce SharePoint2013-Workflow  ,Access
Branding:
 introduce Updated SharePoint Designer,Design manager,channels
Mobile:
 introduce Native support for iOS/Android

4. SharePoint History:
 2001   SharePoint Team Services (free)   - SharePoint Portal Server2001 (lic)
2003 wss2.0 (free)                                       - SharePoint Portal Server2003 (lic)
2007 wss3.0 (free)                                        - Microsoft office SharePoint server (lic)
2010 SharePoint Foundation                     - SharePoint Server2010
2013 SharePoint Foundation +                 - SharePoint Server2013

5. SharePoint Product History:
2001---CMS(failure due to heavy cost) everyting is paid version only
2003---CMS*(better in 2003 beacuse reduces cost and give some features free)
2007---CMS+WCM*( utimate version and most pupular and MS office give freeeeee)
2010---CMS+WCM+ECMS*( rich applications + new and advanced features)
2013-----CMS+WCM+ECMS*+ new advaced feature+apps



6. Content management system (cms):

1.CMS    is a computer program that allows publishingediting and modifying content as well as maintenance from a central interface Such systems of content provide procedures to manage workflow in a collaborative environment.
2. CMS  is a more complex and powerful functions
3.CMSs are often used to run websites containing blogs, news, and shopping. Many corporate and marketing websites use CMSs. 
3 types of CMS
1. Web content management system
2. Component content management system
3. Enterprise content management systems
Enterprise content management types:

7.  Web content management:
Web content management capabilities to create, publish, manage, and control a large, dynamic collection of content. Web content management, as part of Enterprise Content Management (ECM) in Office SharePoint Server 2007, can help streamline your process for creating and publishing Web sites.

8. Document content mgmt system:
Document management  capabilities on the storage and organization of documents to support active work in progress, including content creation and sharing within an organization
Microsoft Office SharePoint Server 2007 supports your organization's document management needs by providing a broad set of document management capabilities that enable you to do the following.
->Store, organize, and locate documents.
->Ensure the consistency of documents.
->Manage metadata for documents.
->Help protect documents from unauthorized access or use.
->Ensure consistent business processes (workflows) for how documents are handled.

9.  STS/SPS
  It STS is running on 2001, SPS  is running on2001 and 2003 paid versions.  
. SharePoint Portal Services (SPS) has MUCH better document management. It has check-in, check-out, versioning, approval, publishing, subscriptions, categories, etc.
. STS does not have these features, or they are very scaled back.
 .SharePoint Portal Services (SPS) has a better search engine, and can crawl multiple content sources.
.STS cannot.
. STS is easier to manage and much better for a team environment where there is not much Document Management going on. SPS is better for an organization, or where Document Management is crucial.

10. Windows Sharepoint Services (WSS)


Windows Sharepoint  Services (WSS) is a portal-based platform for creating, managing and sharing documents and customized Web services. WSS is available as a free download included with every Windows Server license and is considered to be part of the Office 2003 productivity suite. 
11. Whats new in Shared Service Provider (SSP ) in Sharepoint 2010 ? 
      (Alt Q: What is "Service Application" ? )
     “Service Application” or “Service App” is a concept in Sharepoint 2010, 
     where SSP Services are split out into separate services.
     What is replaced?
     1. Profiles, Audiences = People Service App
     2. Search = Search Service App
     3. Excel = Excel Service App
     Whats new :-
     1. Project Server = Project Server App
     2. Visio Services = Visio Service App
     Advantages :-
     1.  Web applications can be configured to only use a subset of the
          deployed services.
     2.  You can deploy multiple instances of the same service in a farm by 
          giving the new service instances unique names.
     3.  You can share services across multiple web applications in a farm.
SSP: The major services that are handled by the SSP are:

  • Profiles and Audiences
  • My Sites
  • Search
  • All of Excel Services
  • All of the BDC (Business Data Catalog)

12. SPSite and SPWeb:
 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.

13. Dispose:   According to the best Practices you should always dispose them if you have created them in your code.
You can dispose them in finally block or you can use the "Using" clause, so that they gets disposed when not required. If you are using SPContext then you need not dispose the spsite or spweb objects.

14. Using Clause:

15. Explain the WebPart life cycle.
WebPart life cycle also same as asp.net life cycle. Here you can find some additional events like CreateChildControls, RenderContents etc.

·         OnInit
·         OnLoad
·         CreateChildControls
·         OnPreRender
·         Render (RenderContents, etc)
- See more at: http://sharepointknowledgebase.blogspot.in/2012/12/sharepoint-developer-interview-questions.html#sthash.UgUlZkFD.dpuf

16. SharePoint Web Application:
->Before you can create a site collection, you must first create a Web application.
->Each Web application is represented by a different IIS Web site with a unique or shared application pool. You can assign each Web application a unique domain name, which helps to prevent cross-site scripting attacks.
You use Web applications to isolate content. When you create a new Web application, you also create a new content database and define the authentication method used to connect to the database. In addition, you define an authentication method to be used by the IIS Web site in SharePoint Foundation 2010.

17. PowerShell:
           Windows PowerShell is an Extendable command shell and scripting language.
           Pre-PowerShell we used to do all sorts of tasks with all sorts of tools:
 Central Administration website
 the SharePoint Products Configuration Wizard
 STSADM
 Psconfig
Use with Stsadm->
Activate / deactivate the feature
Delete / add the feature
Backup/restore
Administrator full access to applicable application programming interfaces (APIs). Administrators can use Windows PowerShell to interact directly with SharePoint-based web applications, site collections, sites, lists, and more.


18.    SharePoint 2010's Search Center

SharePoint 2010 provides a site template that's built for delivering search results. You can use this template to create a branded search experience or to customize how results appear. You can choose among three search center site templates:
Basic Search Center delivers a stripped down search experience in one page. This site template uses Web Part pages and is essentially a team site specialized for search.
Enterprise Search Center provides multiple pages for displaying search results. This site template uses publishing pages, which make it easier to brand and customize than Basic Search Center.
FAST Search Center is used with the add-on search product FAST Search for SharePoint 2010 to provide enhanced search results. Very large enterprises use the FAST search product. Any search solutions you create with SharePoint 2010’s default search options continue to work even if your company chooses to deploy FAST.

                                         SharePoint 2010's Search Center Feature
You can create a new site collection using one of the search center templates and then configure multiple site collections to use that same search center.

19.What is Web part?
Web part is a fundamentally building blocks and for  SharePoint (UI) .
Web Parts are customizable plug and play components that empower information workers to create personalized user interfaces by simply dragging and dropping them on a Web page. Web parts allow customization at both design time and run time. There are two types of web parts.
1. In-built web parts – Web parts that are included in SharePoint. Developers can drag them from web part galleries and drop them into web part zones.

2. Custom web parts – Web parts that are created by the user using visual studio is called custom web parts.

Visual web part:
The new important feature introduced in SharePoint on webparts is Visual webpart. It’s a combination of user control (.ascx) and assembly (.dll)
Since a Visual Web Part loads a User Control (.ascx) from the SharePoint Root it needs access to run the ASP.NET method LoadControl and file system access to the ControlTemplates folder in the SharePoint Root – and this is not allowed by a Sandboxed Solution.

Visual webpart cannot be deploying using sandbox solutions.

SharePoint 2010 difference between webpart and visual web part?
Web Part / Visual Web Part comparision

SharePoint designer:  
1. It is a part of Microsoft SharePoint family of products.
2. SharePoint Designer focuses on designing and personalizing  Microsoft SharePoint websites
3.  It is a specialized HTML editor and web freeware for creating or modifying Microsoft SharePoint sites, workflows and web pages, lists, libraries.
4.we can customize  lists,librariers, designer workflows….

.List:        
 A list contains items that are collections of fields/properties/columns. Optionally each item can have one or more attachments.

. List is a collection of data, collection of records. This is similar to one of the database. It’s storing at Content database.
. List having rows and each rows with appear items, list having fields.
. A list will always have a default view
. A list in SharePoint is used to store data across columns in separate rows.
. There are different data types that can be used for each column.

Library:
A library is a list, but have one and exactly one file associated with each item. A library item also has fields/properties/columns.

A document library is a SharePoint page from where you can share documents and collaborate on your work. Documents are shared, protected, and developed amongst your team. Contributors can view documents in a library, as well as upload, delete, and make changes to documents.

List vs Library:
Lists:
Can have attachments
Have major versions only
Do not have Check-in/Check-out features

Libraries:
Cannot have attachments (files are directly in the library)
Have both minor (draft) and major (published) versioning
Have Check-in/Check-Out
Publishing Libraries can use Page Layouts
Have Unique Document Ids out of the box.

Document library:    Document libraries Consist of your core documents. An example would be a word document, excel, PowerPoint, vision, pdf

Form Library:

A form library is much like a document library, but it is supposed to host only Microsoft InfoPath forms. Microsoft InfoPath is electronic form-creation software that integrates with SharePoint. Forms created with InfoPath can be published to SharePoint form libraries, and users can then fill out these forms.
XML editors or XML-based form design programs that are compatible with Windows SharePoint Services, 



Web.Allowunsafeupdates:    If your code modifies(WSS) Windows SharePoint Services data in some way, you may need to allow unsafe updates on the Web site, without requiring a security validation. You can do by setting the AllowUnsafeUpdates property.
->For developer, when updates needs to be done in the content database without requiring a security validation then AllowUnsafeUpdates property needs to be set to true. After operation is performed then this property again needs to set to false again.

Moss:                                             Sahrepoint server 2010:
MOSS (sp2007) Features               SharePoint Server 2010 Features

Portal                                                            Sites
Search                                                          Communities
Enterprise Content Management                     Content
Business Process and Forms                         Search
Business Intelligence                                      Insights
Collaboration                                                Composites

Moss features:
1) Portal: Provides Single Infrastructure for Intranet, Extranet, Internet, a common navigation across multiple sites and include some customized site templates

2) Collaboration: MOSS allows users to share information and work together and provides a hub

3) Enterprise Content Management: Content management was previously called Microsoft’s Content Management Server 2002. Now release with MOSS 2007.

4) Enterprise Search: New to MOSS 2007 ability to find relevant content in many different locations and formats. Search results that respect security permissions.

5) Business Intelligence: Provides a Report Centre template, Server calculations, web, rendering and Key Performance Indicator (KPI) lists and Web parts.

6) Business Process Provides built-in workflow: and allow you to create, maintain, and analyze custom workflows, helps you to streamline your collaborative processes.

SharePoint2010 Main Features:

 Document Collaboration

 Enterprise Search FAST Search
 New Enhance Web Part
Silver Light web part
Business Connectivity Services
Social Media Investments
Large lists
Enhanced collaboration features
Visio Services
Usage reporting and loggin
Better Network Differencing & SharePoint Offline in SharePoint Workspace
High Availability/ Disaster Recovery Innovatio.
Admin Insights through the Logging & Usage database, and dev dashboard
 Service Applications
 SharePoint Designer Enhancements like portable
workflows, and granular delegation
 Sandbox Solutions

WSS vsMOSS2007:

 .WSS in not a portal, it's only a collaborative platform (there are no publishing features in WSS)
.MOSS allows you to use user profiles, not WSS.
.Search functionalities are cheap in WSS compare to MOSS (but you can extend them using Search              Server Express)
.Many others: InfoPath, BDC, Additional Web Parts, Additional site and list templates.

Site collection: 
A site collection is a grouping of websites under a common top-level site that have the same owner and share administration settings,

for example, permissions. When you create a site collection, a top-level site is automatically created in the site collection.
 You can then create one or more subsites below the top-level site.
A site collection is made up of one top-level site and all sites
it is the top level of organization in a SharePoint 2013 web application.
 The number of site collections you can have in a single web application depends on the capacity of your server infrastructure.

Sub sites:

è Top-level Web sites can have multiple sub sites, and sub sites can also have multiple sub sites. You can use top-level Web site and sub sites to divide site content into distinct, separately manageable sites.

List Defination:
è we can create a List Definition using:
è                    1) SharePoint user interface
è                    2) Visual Studio 2010
è  

Site definition:
1. Site definition is installed on file system of web front ends.
2. Located at..\14\Templates\Site Templates.
3. Site definition consists of .aspx pages and .xml files with Collaborative Application Markup Language (CAML).
4. Major Benifit is that the page and List definition is read locally from the File System, not from Content Database.


                                           Site definition vs Site template:
Files are on disk, better performance.
Files are in database, less efficient.
Highly customizable and extensible (XML  and .NET code is much more flexible than UI)
Not easily extensible  (You are limited by what UI offers)
Can provision multiple webs *
Can only provision one web
Complex to create
Easier to create
Requires admin access to server for deploying.
Installable from a Web UI by site owners.
Modifying the site definition after provisioning at least one site from it is not supported and might break existing sites.
Custom templates can be modified without affecting existing sites that have been created from the templates (**).

Site Definitions are stored on the hard drive of the SharePoint front end servers. They are used by the SharePoint application to generate the sites users can create. Site Templates are created by users as a copy of a site they have configured and modified so that they do not have to recreate lists, libraries, views and columns every time they need a new instance of a site.


Event Receivers: If you want to catch some action in SharePoint and want to do something on each action, then you can use event receivers’. Event receivers are nothing but classes.

Sometimes they are called before events and after events.

Types also includes :
1) Item-Level Event Receivers 

2) List-Level Event Receivers,

 3)Web-Level Event Receivers,

4)Workflow Event Receivers 


Event Handler:  It is a similar of the Event receivers. Event Receivers or Event handlers are created to handle the basic actions or events against an item, list\library, a web or a site.    4 types of
•   List Items – SPItemEventReceiver 
•   List Columns – SPListEventReceiver 
•   Site – SPWebEventReceiver 
•   Email – SPEmailEventReceiver

Event Receivers vs. Event Handler:

Event Receivers or Event handlers are created to handle the basic actions or events against an item, list\library, a web or a site.
There are two kinds of events in SharePoint. They are:
1) Synchronous Events: Like Item adding (not added yet), Uploading (document not uploaded yet) etc.
2) Asynchronous Events: Item Added (after item is added), Uploaded(after a document is uploaded)

Events receivers can be written to override an event.
For e.g. Item Added event to change the name of an Item once it is added.

SharePoint Farm:
ð  A SharePoint Farm is a collection of one or more sharepoint server which 
       having a single configuration database.
ð  A SharePoint farm is a collection of SharePoint servers or SQL servers that work in concert to provide a set of basic SharePoint services that support a single site. 
ð  Farm solutions are installed to the solution store of a farm by a farm administrator. The components in the solution can, and usually do, run in full trust, and no resource usage restrictions are placed on them.

Content type:
A Content Type is a reusable, shareable metadata. The base type of a content type could be an existing content type like:   item, Document, Folder, Event, Task, Meesage, Cooment, Post…..
-> We can create content types in SharePoint by the following 3 ways:

a. From UI
b. Using CAML (Collaborative Application Markup Language)
c. Using SharePoint Object Model (i.e. Programmatically)
-> We can associate one content types to multiple lists and libraries

Organizations can define each of these different sets of documents as a content type. A content type is a group of reusable settings that describe the shared attributes and behaviors for a specific kind of content. Content types can be defined for any item type, including documents, list items, media files, and folders.

Site Content Type:

List Content Type:

Metadata:   
 1. Managed Metadata is a hierarchical collection of terms that can be associated with items in SharePoint 2010. 
2. We can use Central Administration website to manage these terms.
This is a new feature in SharePoint 2010.

Example: You have a document library to upload articles.  For each item you can specify a column metadata of category like C#, ASP.NET etc.
  • Term: A term is keyword that can be associated with a SharePoint item.
  • Term Set: A term set is a group of terms.  You can restrict that a particular item should contain a term from a particular term set.  For example: setting the category of an article item from term set [C#, ASP.NET].
  • Local Term Sets: Site collection scoped term set.  Only site user can see it.
  • Global Term Sets: Global Term Set created outside the site collection.  They are visible to all users.
http://www.codeproject.com/Tips/401716/SharePoint-2010-Managed-Metadata-Configuration-and

Farm Solutions: The scope of farm level solution is farm level so it has Full trusted access to all resources and functionality of SharePoint.


                Sandbox solution vs Form solution
In SharePoint 2010 we can have two types of solutions one is Sandboxed Solution and Farm Solution while developing a solution in Visual Studio 2010.
One major difference in the deployment is Farm solutions are installed and deployed. Sandboxed solutions are uploaded and activated.
Farm Solutions:
- Farm solutions are hosted in the IIS worker process (W3WP.exe).
- If you run any code in farm solution the whole farm will got affected.
- If you deploy any feature or retract any feature the whole application pool got recycled.
- Since they are scoped as farm level, they have full trust access to all the resources.
- When the Sandboxed Solution property is set to False, selecting Build\Deploy will deploy the solution to the Farm Solution Gallery.

Sandboxed Solution:
- Sandboxed solutions are hosted in the SharePoint user code solution worker process (SPUCWorkerProcess.exe).
- The process runs under a CAS policy that restricts programmatic access to any resource outside the sandbox.
- Never restart the IIS application pool.
- If you run any code it will affect only the site collection of the solution.
- Helpful if you have shared hosting.
- When the Sandboxed Solution property is set to True, selecting Build\Deploy Solution deploys the solution to the site collection Solution Gallery.
 we create use with sandbox:
 list definition
list instances
webparts
event receivers
Feature receivers
Designer workflows
infopath busines logics
    
      1.we can't create Aplication pages in Sandbox solutions.
      2.Beacuse Application pages are stored in the 14\TEMPLATES\_LAYOUTS and when we deploy as  sandbox we dont have permissions to the physical folder.
      3.We cant use code to connect to the external web services or to database in the sandbox soltion
      4.runwithelevatedprivileges doesn't work 
      5.Site collection adminstrator can deploy a Sandboxed solutions, 
      


Templates:  Site template, Web template, Library template, List template
Custom Templates:
These templates can be located at C:\Program Files\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\1033.
->Advantages of having custom templates.
->You can control  the Look and feel of the web site page.
->You can have your predefined custom web parts.
->Not required to drag and drop web parts.
->Same look and feel across the web site page.
Httphandler: Every request into an ASP.NET application is handled by a specialized component known as an HTTP handler. The HTTP handler is the most important ingredient while handling ASP.NET requests
In use with sharepoint you need to deploy your code to in the GAC.
ASP.NET default handlers:
Page Handler (.aspx) - Handles Web pages
User Control Handler (.ascx) - Handles Web user control pages
Web Service Handler (.asmx) - Handles Web service pages
Trace Handler (trace.axd) - Handles trace functionality

Using SharePoint 2010, the HTTP handler was deployed to the LAYOUTS folder. The trick here is that SharePoint needs to load all its referenced assemblies from the GAC and in this case the assembly was in the GAC but we were not referencing the FQDN of the assembly.

Webpartzones:
Web Parts located in a Web Part zone    When a Web Part is located inside a Web Part zone, the Web Part properties are stored in the content database in Windows SharePoint Services 3.0, not in the ASPX page. By inserting a Web Part inside a zone, you make it possible for users to interact with or modify that Web Part through the browser.
Web Parts not located in a Web Part zone    When a Web Part is not located inside a Web Part zone, the Web Part properties are stored in the ASPX page and not in the content database in Windows SharePoint Services 3.0. By inserting a Web Part without enclosing it in a zone, 
                                         
                                         Application page     and   Site Pages:
     
Application page:  Application pages are shared across all sites on the server, whereas a site page is specific to one site.
To create an application page, add an Application Page item to a SharePoint project. When you create an application page, Visual Studio adds the following folders to your project:
        ->   Application page is an ASP.NET content page present LAYOUTs directory
“C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS “
  
a.       .        An application page can have code behind as well as inline code
b.       .        An application page doesn’t support web parts or web part zones
c.       .        Application page is available to all the sites,
d.       .        Application page must deployed only in farm solution,
Site Pages:

1.     Site Pages are stored in the virtual file system in the Content databases
2.     Site page can’t have code behind or inline code.
3.     Site Pages supports web parts
4.     Site page can be deployed only specific sites
5.     Site Page can be deployed using a sandbox solution
6.     Site pages can be deployed by site collection administrators/end-users.

Site Pages:  
1.To create a new page, click Site Actions, then select New Page.
2. After naming the page, a blank content area appears.

Choose your page layout by selecting it from the drop-down list under Text Layout. Formatted text , different styles , tabs ...etc.
3. Site Pages are have not webpart zones.

Master page:

-> Page layouts contains is a  field controls and Web Parts
Master pages and page layouts dictate the overall look and feel of your SharePoint site

->you can quickly change the appearance of an entire site.

->This article shows you how to create and modify a copy of the existing primary master page and then apply the new or modified master page to all of the pages in your site that are attached to the primary master.

Master pages contain controls that are shared across multiple page layouts, such as navigation, search, or language-preference for multilingual sites.
->Master pages and content pages work together using a set of replaceable regions, or content placeholder controls


->   inside content placeholders in your SharePoint 2010 page layout. Although you can place text and HTML markup inside placeholders, most often you put fields, controls, containers, and Web Parts in your page layout.

Here are multiple control types that you can put in a page layout to contain content:

Web Parts/Web Part zones:
HTML controls:
ASP.NET controls: 
sharepoint controls
dataview controls
Content controls: 
content fields


Page-layouts:

 Master pages and page layouts dictate the overall look and feel of your SharePoint site.
Master pages contain controls that are shared across multiple page layouts, such as navigation, search, or language-preference for multilingual sites. Page layouts contain field controls and Web Parts

By using master pages, you can provide a consistent look and feel for your site. You can use master pages to position items that must be shared by all pages, such as navigational controls, company logos, and copyright notices. Within master pages, you can use user controls (.ascx controls), Web server controls, and Web Parts.

v4.masterpage:
V4Materpage in a one of the primary page in masterpage.
->Team Site home page, list and library pages, and site settings page.
               ->Used for content and administration pages. Provides the interface and layout for SharePoint 2010.

Minimal master page:
The home and search results pages on a Search Center, pages that host Word or Excel web applications.
Contains minimal SharePoint content, used for full-screen functionality or embedded applications.



What is solution:
Ans. Solutions are the container packages for Features. Solution basically, is a cabinet (.cab) file with extension .wsp which contains various components needed to be deployed (features, web parts, custom forms etc) along with files that describe some important metadata about those Components. Once a Solution is installed on a server in the farm, you can deploy it to any web application from your Solution Management

Security levels in SharePoint:

Full Control:   Enables users to have full control of the website.
Design:              Enables users to view, add, update, delete, approve, and customize items or pages in the website.
Contribute:       Enables users to manage personal views, edit items and user information, delete versions in existing lists and                    
                                                        document libraries, and add, remove, and update personal Web Parts.
Edit:                    Enables users to manage lists.
Read:                   Enables users to view pages and list items, and to download documents.
View only:        Enables users to view application pages. The View Only permission level is used for the Excel Services Viewers                   group.
Limited Access: Enables users to access shared resources and a specific list, document library, folder, list item, or document.

If you use a site template other than the team site template, you will see a different list of default SharePoint permission levels. For example, 

1. Approve 2. Manage Hierarchy 3. Restricted Read

                                   Limited Access cannot be edited or deleted.
                                                     Special Permissions
  • Site level Controls access to the site and any objects that inherit their permissions from the site.
  • List or library level   Controls access to the list and all folder and items in the list that inherit their permissions from the list.
  • Folder level   Controls access to the folder itself and any items in that folder that inherit their permissions from the folder.
  • Item level or document level   Controls access to a specific list item or a document.

Where are Master Pages and Layout Pages located in a SharePoint site?
They are location in master Page(Master Page Gallery) under _catalogs folder of root site.
- See more at: http://sharepointknowledgebase.blogspot.in/2012/12/sharepoint-developer-interview-questions.html#sthash.UgUlZkFD.dpuf

2010     vs   2013
Developement changes
Socail and collaboration Fetures
Search
Enterprise Content Mangement
Server object model , Client object model , silverlight  and javascript..

interview Questions for Developers - A four-part series.

Managed Object Model
Microsoft.SharePoint .Client.dll
Microsoft.SharePoint .ClientRuntime.dll
ISAPI folder
Silverlight client object model
Microsoft.SharePoint .Client.Silverlight.dll
Microsoft.SharePoint .Client.Silverlight.Runtime.dll
LAYOUTS\ClientBin folder
JavaScript client object model
SP.js
LAYOUTS folder
Different types of Objects:
Server object model
Managed Model
Silverlight Model
Javascript Model
SPContext
ClientContext
ClientContext
ClientContext
SPSite
Site
Site
Site
SPWeb
Web
Web
Web
SPList
List
List
List
SPListItem
ListItem
ListItem
ListItem
SPField
Field
Field
Field

SandBox Solutions support the following SharePoint  item types:
-       List definitions
-       List instances
-       Content Types/Fields
-       Navigation
-       Web Parts derived from WebPart
-       Event receivers
-       Custom Workflow Actions

-       Workflow
-       Doesn’t Supported
-       programmatic workflow
-       Event receivers
o    SPLimitedWebPartManager
-       timer jobs
-       visual WebParts
-       SharePoint  mapped folders (e.g. "_layouts", and "images")


SharePoint  2010's Content Query Web Part(cqwp):

1. Content Query Web Part(cqwp) contains we can get items list items , library documents ,     content types from different sites and sub-sites Or Entire site-collection
      2. we can configure to filtering , audience targeting
      3.If u want create cqwp 
                                       First you need to activate Fetures is  "SharePoint server publishing infrastructure"
        4. After then u can get the cqwp in webpart gallary

SharePoint  2010's Content Editor Web Part(cewp):
->Content Editor Web Part to add formatted text, tables, hyperlinks, and images to a Web page.

Ways you can use the Content Editor Web Part

-You can use the Content Editor Web Part to add:
->An introductory, formatted paragraph to a page.
-> A table of instructions to explain a chart on your page, the data that is used in the chart, and how the chart was created.
->A set of hyperlinks to more information


Difference between List Definition, List Template and List Instance in SharePoint  2010:
 List Definition:

A list definition defines a schema for a SharePoint  list. It contains information on what views are being used, which columns and content types are being used, and other metadata information.
List Template:

A list template can either be created by end users through the SharePoint  user interface using an existing list as a pattern or using an existing list instance. If based on a user-created list it is called a custom list template. A custom list template includes everything that defines the list, including list columns and site columns used by the list, content types used by the list, views defined for the list, and so on

What is an InfoPath?
InfoPath is an XML based electronic forms development product. 
InfoPath is an application to create XML based Data entry Forms and targeted for end users and developers.

- How to deploy Infopath form in Sharepoint site?

->If you customize a SharePoint list form with InfoPath, just click the Publish button. If you create a Browser form, you can publish it to a Forms Library, either as a content type or an actual library item.

->InfoPath List Forms do not support any kind of code. InfoPath browser forms do support code.

->Ability to convert Word and Excel documents into InfoPath form templates.
->we can create infopth form for new sharepoint list
    we can create customize an existing sharepoint list

->in that infopath designer in there having field pane.

Linq

What is LINQ and why it’s useful in LINQ?

LINQ is Language integrated Query Language. It’s part of .Net framework, you can easily integrate this with SharePoint 2010. It’s used to Query on Data sources such as Object, Datasets, SQL, XML and other entities. LINQ provide access to sharepoint in TYPED Manner, you can easily access List columns name as property. As syntax is same as it is for .net development.
var items = from s in DataContext.Students
           select s;

Microsoft SharePoint 2010 brings support for Language-Integrated Query (LINQ) to the platform, which can improve the productivity and efficiency of developers reading and writing to SharePoint lists.

    1.  LINQ to SharePointprovider and the SPMetal.exe utility.

    2. SharePoint developers can write LINQ queries. At compile time, the LINQ queries will be translated to CAML queries.

LINQ to SharePoint is a new feature of SharePoint 2010. LINQ stands for Language Integrated Query which is a part of .NET. The aim of LINQ is to support different data sources using the same Typed Query Syntax. Presently it supports Objects, Datasets, SQL, Entities, XML, etc.


CAML:.
CAML - Collaborative Application Markup Language
  Ø  XML- Extensible Markup Language based query language
  Ø  Used to perform a query operation against SharePoint Lists
CAML stands for Collaborative Application Markup Language. CAML is  XML based language which provides data constructs that build up the SharePoint fields, view, and is used for table definition during site provisioning

1. CAML is always better than LINQ because if you write LINQ query then finally it converts in CAML internally so it down the performance. 
2. Of course there is other advantages of LINQ like: Sorting/filtering/can return objects / 
3. Most imp part, it is object oriented etc.

Disadvantages of using Linq:     1. During the run time the LINQ query itself gets converted into a CAML query, which is an extra step ahead that takes more time . This can be avoided if we write a CAML query itself straight away.

2.  Also, we generate a DataContext class using the SPMetal.exe. This class is the one which we use in our project to generate LINQ queries. This class is not generated dynamically. So, if we do any changes in any of the lists or libraries in our site it is not reflected in the DataContext class. We have to generate a new class whenever we make any changes in the site.
3. Unlike CAML queries, LINQ to SharePoint has no use if we are going to access SharePoint data in Silverlight using Client Object Model.
4. Fields like Created, CreatedBy, Modified and ModifiedBy of a SharePoint list are not created by SPMetal to be used in the LINQ queries.
5. LINQ to SharePoint cannot be implemented for an External list.

Client Object Model

Microsoft SharePoint 2010 Software Development Kit (SDK) introduces three new client APIs that allow you to interact with SharePoint sites from script that executes in the browser
  1. from code (no earlier than Microsoft .NET Framework 3.5) that executes in a .NET managed application, or   
 2. from code that executes in a Microsoft Silverlight 2.0 application. 
3.; The new ECMAScript (JavaScript, JScript),
The following table shows the equivalent objects that the new APIs provide for common SharePoint Foundation 2010 server objects.
Client Object Model vs Server Object Model in SharePoint 2010 ?


Using Client Object Model we can access the data from the system where SharePoint server is not installed on the machine via Web Services, API(application porgramming interface) , JavaScript etc.

Whereas In Server Object Model is like a Production Server Environment to access the data where share point server installed on the machine
workflow
1). The workflow feature in Microsoft SharePoint Server 2010 enables solution architects, designers, and administrators to improve business processes

2). SharePoint Foundation 2010 workflows are made available to end-users at the list or document-library level. Workflows can be added to documents or list items. Workflowcan also be added to content types.

3). Multiple workflows can run simultaneously on the same item, but only one instance of a specific workflow can run on a specific item

Fundamentally, a workflow consists of two things:

1. The forms that a workflow uses to interact with its users and the logic that defines the workflow’s behavior. 
2. Understanding how workflows are created requires knowledge about both.

Workflow's are  associated with List , Library, Site content type , Site


Benefits of using workflows

The primary benefits of using workflows are to facilitate business processes and improve collaboration.

Workflow life cycle:
SharePoint workflow cycle is very much unique to SharePoint environment. SharePoint workflows are always connected in context with SharePoint content like list or a document.
There are four stages in the SharePoint workflow cycle. They are 


AssociateAssociation forms address how the workflow applies to a specific list, library, or content type. In this stage, workflow is associated with a content type like list or a document.
Association forms are displayed to administrators when they first decide to add—or associate—a workflow with a particular list, document library, or content type.

Initiate: Initiation forms address how the workflow applies to a specific SharePoint item. In this stage, the workflow created is to be initiated. Workflow are noting but classes. So a workflow instance needs to be created to start the workflow in action.
Initiation forms are displayed to users when they start a workflow on a specific SharePoint item.

Modify: In third stage, the instance of the workflow is modified as per the workflow stages.

Complete: Finally the workflow object is terminated.

Site definitoin
site definition is the basic blueprint for a site.

  -> site definition consists of .aspx pages and .xml files with Collaborative Application Mark-up Language (CAML).

  -> major benefit is that the Page and List definition is read locally from the file system, not from Content Database.



               A site definition in Sharepoint consists of two parts

ONET.xml: Contains the bulk of the actual site definition
WEBTEMP.xml: it contains This is a collection of templates which are defined by ONET.xml files.

Feature:

Features are Packages of functionality ,That you can activated and deactivated in a SharePoint Farm.
  They have four Possible scopes:

A SharePoint Feature is a Functional component that can be used for activated and deactivated at various scopes throughout a SharePoint instances, scope of which are defined as 

Feature Scopes
FARM - Activate Feature for an entire server farm.  ->  is something that affects the whole farm,
    Example: For example provisioning a custom timer job or deploying a BCS model.

WEB APPLICATION - Activate Feature for all websites in a web application.-> only affects a single web application,
  Example: Activate  Feature that modifies the web.config file.

SITE   - Activate Feature for all websites in a site collection. only affects a site collection
Example:  an example being the deployment of a master page to the master pages catalogue.
WEB   - Activate Feature for a Specific website. 
Example:    instance setting the default master page for that site.

Features have their own receiver architecturewhich allow you to trap events such as when a feature is Installing, Uninstalling, Activated, or Deactivated. 


Feature Components:
We can create menu commands, 1)Custom Actions 2)page templates 3)page instances, 4)list definitions, 5)list instances,6)event handlers,7)web parts  8)workflows as feature.

Timer job

1. A Timer Job is a periodically executed task inside SharePoint Server. 
2. It provides us a task execution environment.


3. These tasks will having execution periods like:


Minute, hour, day, week, monthly, yearly
  
There are many timer jobs inside SharePoint which do internal tasks like:
     :   Send emails
      : Validate sites
      : Delete unused sites
      : Health analysis
      : Product versioning
       : Diagnostics

  • Timer Jobs can be scheduled for automating jobs inside SharePoint 2010
  • SPJobDefinition is the base class for Timer Job
  • Create Event Receiver Feature to create or delete the timer job
  • SPFeatureReceiver is the base class for the event receiver
  • The feature gets deployed in the 14hive folder
  • OWSTIMER.EXE is the process executing Timer Jobs

SPSecurity.RunWithElevatedPrivileges Method

RunWithElevatedPrivileges Method:



Executes the specified method with Full Control rights even if the user does not otherwise have Full Control.

A delegate method that is to run with elevated rights. This method runs under the Application Pool identity, which has site collection administrator privileges on all site collections hosted by that application pool.

SPSecurity.RunWithElevatedPrivileges(delegate()
{
    using (SPSite site = new SPSite(web.Site.ID))
    {
    // implementation details omitted
    }
});

               EventReceivers:

an item is being deleted  -> itemdeleting

an items was deleted      -> itemdeleted

        1).Itemdeleting

/// <summary>
/// An item is being deleted.
/// </summary>
public override void ItemDeleting(SPItemEventProperties properties)
{
    base.ItemDeleting(properties);
    properties.Status = SPEventReceiverStatus.CancelWithError/CancelWithredirectUrl;
    properties.ErrorMessage = "This item cannot be deleted; Contact your administrator";
    properties.Cancel = true;
}
The above snippet generates the following error when a user tries to delete an item in a list where the event receiver is active:
error screenshot from event receiver
     


        2).Itemdeleting:

 public override void ItemDeleting(SPItemEventProperties properties)
       {
           try
           {
               base.ItemDeleting(properties);
               StringBuilder strMessage = new StringBuilder();
               using (SPSite oSite = new SPSite(properties.SiteId))
               {
                   using (SPWeb oWeb = oSite.OpenWeb(properties.Web.ID))
                   {
                       SPList list = oWeb.Lists.TryGetList("TheTeam");
                       if (properties.List.ID == list.ID)
                       {
                           //<summery>
                           // here condition defines to the listitem is not null nad employeename not null and employeename is av2 then it will be effect to list item.ope error page
                           //</summery>
                           if (properties.ListItem != null && properties.ListItem["employeename"] != null && properties.ListItem["employeename"].ToString().Equals("av2"))
                           {
                               properties.Cancel = true;
                               properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl;
                               properties.ErrorMessage = "its unable to deleting please contact your administrator";
                               //properties.RedirectUrl = oSite.Url + "/_layouts/Seal/CustomErrorPage.aspx";
                           }
                       }
                   }
               }
               
           }
           catch (Exception e)
           {
               //properties.Status = SPEventReceiverStatus.CancelWithError;
               //properties.ErrorMessage = "its unable to deleting please contact your administrator";
               //properties.Cancel = true;
           }
       }
Resulting error Resulting error
   3).Itemdeleting:
Code:


 ItemDeleted EventReceiver
 public override void ItemDeleted(SPItemEventProperties properties)
       {
           
           try
           {
               base.ItemDeleted(properties);
               StringBuilder strMessage = new StringBuilder();
               using (SPSite oSite = new SPSite(properties.SiteId))
               {
                   using (SPWeb oWeb = oSite.OpenWeb(properties.Web.ID))
                   {
                       SPList list = oWeb.Lists.TryGetList("TheTeam2");
                       SPListItemCollection coll=list.Items;
                       SPListItem item=coll.Add();
                       if (properties.List.ID == list.ID)
                       {
                           //<summery>
                           // here condition defines to the listitem is not null nad employeename not null and employeename is av2 then it will be effect to list item.ope error page
                           //</summery>
                           item["mgr"]="venu";
                           item["Companyname"] = "HP";
                           item.Update();
                              
                           }
                       }
                   }
              

           }
           catch (Exception e)
           {
               //properties.Status = SPEventReceiverStatus.CancelWithError;
               //properties.ErrorMessage = "its unable to deleting please contact your administrator";
               //properties.Cancel = true;
           }
       }

              SPSiteDataQuery
SPSiteDataQuery is used to retrieve data from list or from all list in the site collection ( used for cross-site and cross-list queries).
SPSiteDataQuery.Webs property will be used to specify from where the data will be retrieved.
  Example Syntax:
   Mysite= SPContext.Current.Web.Url;
            using (SPSite site = new SPSite(Mysite))
            {
                using (SPWeb web = site.RootWeb)
                {
                    SPSiteDataQuery dataQuery = new SPSiteDataQuery();
                    dataQuery.Webs = "<Webs Scope=\"Recursive\">";
                    dataQuery.Lists = "<Lists ServerTemplate=\"101\" />";
                    dataQuery.ViewFields = "<FieldRef Name=\"DocumentNo\"/>" + "<FieldRef Name=\"Title\" />" + "<FieldRef Name=\"Tags\" />" + "<FieldRef Name=\"FileRef\" />";
                    string where = "";
                    where = "<Where>";
                     
                    if (txtDocumentNo.Text != "")
                    {
                        where += "<Eq>";
                        where += "<FieldRef Name=\"DocumentNo\"/>";
                        where += "<Value Type='Text'>" + txtDocumentNo.Text + "</Value>";
                        where += "</Eq>";
                    }
                    where += "</Where>";
                    dataQuery.Query = where;
                    DataTable dt = web.GetSiteData(dataQuery);
                    DataView dv = new DataView(dt);
                    gvResult.DataSource = dv;
                    gvResult.DataBind();
                     
                }



Customer code for SPDataQuery
http://www.codeproject.com/Tips/401818/SharePoint-SPSiteDataQuery-with-Example


The JavaScript client object model provides the SP.UI.ModalDialog class to work with the dialog framework.
  1. The JavaScript files for the ECMAScript Object Model (SP.js, SP.Core.js, SP.Ribbon.js, and SP.Runtime.js ) are installed in the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS directory. We need to add these JavaScript files in the page.
  2. To open a dialog we need to use the 'SP.UI.ModalDialog.showModalDialog' method from the ECMAScript Client Object model and we can pass following parameters as per requirement:
  1. Following Parameters as per Requirement:
width: Set the width of the modal dialog
height: Set the height of the modal dialog
html: the ID HTML control or HTML content to be displayed in modal dialog
url: Page url or relative path
dialogReturnValueCallback: In case we want some code to run after the dialog is closed, set JavaScript method name
allowMaximize: Set to true or false to show hide this option.
showClose: Set to true or false to show or hide the close button
1). In order to work with the dialog framework, we need to first create the dialog options:
var options = SP.UI.$create_DialogOptions();
options.width = 500;
options.height = 250;
options.url = "/_layouts/StandardsPortal/ChangePassword.aspx";
options.dialogReturnValueCallback = Function.createDelegate(
                    null, portal_modalDialogClosedCallback);
SP.UI.ModalDialog.showModalDialog(options);
2).You can now call this JavaScript function from your custom action or from web part or from your custom page or from your custom Ribbon button. Below is the custom action XML:
<CustomAction
   Id="{F93B1F84-1DBE-4C10-82E3-2CA47346359E}"
   Title="Change Password"
   Description="Change your password"
   Sequence="1000"
   Location="Microsoft.SharePoint.StandardMenu"
   GroupId="PersonalActions"
   ImageUrl="~sitecollection/_layouts/images/menulistsettings.gif">
   <UrlAction Url="javascript:portal_openModalDialog();"/>
</CustomAction>
3). SP.UI.DialogResult.OK and SP.UI.DialogResult.cancel properties:
 function CloseCallback(result, value) {
        if(result === SP.UI.DialogResult.OK) {
            alert("OK was clicked!");
        }
        if(result === SP.UI.DialogResult.cancel) {
            alert("Cancel was clicked!");
        }
 }


Client Object Model Example:

The Client OM works by sending an XML Request. The server will return a JSON response which is converted to the appropriate Object Model.


Supported Languages

Following are the programming language/platforms supported for Client Object Model:

  • .NET Languages (C#, VB.NET etc.)
  • Silverlight
  • Scripting Languages (JavaScript, Jscript)


GHOSTING AND UNGHOSTING IN SHAREPOINT 2010

Ghosting:

     Basically any file which is not stored in content database, stored in file system.is known as ghosted file.

         ex:  default.masterpage

UnGhosting:
files are stored in content database not in file system is as called unghosted files.

    Application Pages :  Normal asp.Net pages stored on file system.
    site pages :                Normal content pages stored in db.

What is Impersonation?

Impersonation is the security feature that enables to control the Identity under which code is executed. Impersonation gives the following advantages:
  • Run a high privilege code through a low privilege user
  • Record changes in account of another user
Example code:
string siteStr = "http://mysharepointsite/";
//we just need to get a handle to the site for us
//to get the system account user token
SPSite tempSite = new SPSite(siteStr);
SPUserToken systoken = tempSite.SystemAccount.UserToken;
using (SPSite site = new SPSite(siteStr, systoken))
{
   using (SPWeb web = site.OpenWeb())
   {
       //right now, logged in as Site System Account
       Console.WriteLine("Currently logged in as: " +
                        web.CurrentUser.ToString());
       //add your code here
   }
}


    Create Child Controls

Creates any child controls necessary to render the field, such as a label control, link control, or text box control.

http://stackoverflow.com/questions/17065543/createchildcontrols-in-visual-web-part-in-sharepoint-2010-called-twice

1). Example if not post back,
then my CreateChildControls() is being executed before my Load event. But
for post back, my Load event executes before my CreateChildControls().

2). The CreateChildControls method is not listed in the table because it is
called whenever the ASP.NET page framework needs to create the controls tree
and this method call is not limited to a specific phase in a control's
lifecycle. For example, CreateChildControls can be invoked when loading a
page, during data binding, or during rendering.

Document Set


   It is a one of Content type in sharepoint.
How to create document set in SharePoint 2010
Document Set is used to manage set of documents as a single object
It is a new feature introduced in Share Point 2010.

Advantages of using Document Set in Share Point 2010.

Work Flow can be associated to a whole document set.
We can upload project related documents in Document set.
We can maintain the version of all related documents using Document set.
We can manage permissions easily.
We can able to set customizable welcome page for Document Set.
We can download all the zip files easily by using Document Set.
There is no limit that no of documents exit in Document set.

Drop Of Library:

Content Organiser  Rules. document content type.
                                    


BCS
Microsoft Business Connectivity Services (BCS) (formerly named the Business Data Catalog) provides read/write access to external data from line-of-business (LOB) systems, Web services, databases, and other external systems 
within Microsoft SharePoint 2010 and Microsoft Office 2010 applications.Both SharePoint 2010 and Office 2010 applications have product features that can use external data directly, both online and offline. Developers can gain access to a rich set of features and rapidly build solutions using familiar tools such as Microsoft Visual Studio 2010 and Microsoft SharePoint Designer 2010.
Business Connectivity Services enhances Office application and SharePoint application capabilities and their user interface (UI) through features, services, and tools. These enhanced capabilities and UI streamline development of solutions with deep integration of external data and services. Experienced users, developers, and business unit IT professionals can integrate assets from external systems and enable interaction with the external data through many types of Office client and server applications.The Business Connectivity Services feature set enables rapid development and deployment of scalable and security-rich solutions. The following diagram shows a high-level view of Business Connectivity Services.
High-level view of Business Connectivity Services





What is LINQ to Sharepoint ?

Ans.
·                     LINQ is a feature of the programming languages C# 3.0 and Visual Basic .NET
·                     LINQ adds, to each of the languages, a SQL-like syntax and vocabulary for querying data sources.
·                     LINQ to Sharepoint allows developers to use SQL-like syntax to query Lists and Libraries in Sharepoint.
·                     LINQ to Sharepoint internally converts the LINQ query to a CAML query to fetch records
·                     Advantage : Strongly typed access to the entities of the list.
·                     Disadvantage : If the new columns are added or its datatype changed, the datacontext class used by LINQ is no longer valid and may break the code










No comments:

Post a Comment