Friday, June 21, 2013

SharePoint 2013 Interview Questions for Developers – Part 2

Q41: Whats are the new Delegate Controls in SharePoint 2013?
Ans: 
In SharePoint 2013, three New Delegate Controls have been Introduced for the purpose of displaying the new Top Suite bar (with links SkyDrive, NewsFeed,Sync,follow). These Controls are -
  • SuiteBarBrandingDelegate delegate Control
  • SuiteLinksDelegate delegate Control
  • PromotedActions Delegate Control
Q42: What is SuiteBarBrandingDelegate delegate Control used for?
Ans:
 SuiteBarBrandingDelegate Delegate Control is responsible for displaying ‘SharePoint’ or ‘Office 365′ text on top left of the new SharePoint 2013 site (in the blue bar). This text can only be replaced by Overriding SuiteBarBrandingDelegate Delegate Control with a custom Custom Control Created using Visual Studio.
Q43: What is SuiteLinksDelegate delegate Control used for?
Ans:
 SuiteLinksDelegate Delegate Control is responsible for displaying Links “NewsFeed, SkyDrive and Sites” in top right of the new SharePoint 2013 site (in the blue bar). These Links can be replaced by Overriding SuiteLinksDelegate Delegate Control using a Custom Control Created using Visual Studio.
Q44: What is PromotedActions delegate Control used for?
Ans:
 PromotedActions Delegate Control is responsible for displaying Links “Share,Follow,SYNC,EDIT” in top right below SuiteLinksDelegate Control. These Links can be replaced by Overriding PromotedActions Delegate Control using a Custom Control Created using Visual Studio.
Q46: What are Callout Popups in SharePoint 2013.
Ans:
 Similar to Dialog framework in SharePoint 2010, Microsoft has added a new Callout Popup framework to Create Hover Popups that you know as Preview Windows as well.These Notification\Tooltip\Help (whatever you call it..) Callout Popups can be fully Customized to add Custom Text & Actions for guiding End-users.
Q47: Is Callout Popups a replacement to Dialogs in SharePoint 2013.
Ans:
 No. Dialog Framework still exists.
Q48: Can we view PDF files in Callout Popups?
Ans:
 Yes. A Custom Result type and Display template would be needed.
Q49: What’s the new “SPField.JSLink” property used for?
Ans:
 New “SPField.JSLink” property has been added to help specify any external JavaScript file Containing any Rendering logic for Out-of-Box or Custom field type.With JSLink developers can now Control the Rendering (the presentation and validation) of any Field (Custom or Out-of-box) on List forms as well as in Views by simply adding a reference to an External or deployed JavaScript file.
Q50: What’s the new SPSecurityEventReceiver?
Ans:
 In SharePoint 2013, MS has added “SPSecurityEventReceiver” class to handle events for SharePoint Groups, Users, Roles and Permission Inheritance.
Q51: Can I turn off Social – Follow & Site Feed in SharePoint 2013?
Ans:
 Yes.You Can de-activiate Follow & Social by disabling “Following Content feature” and “Site Feeds feature” on the Team site(in the written Order).By default, the Site feed feature on a team site is enabled.

Using Content Search In SharePoint 2013

The Content Search Web Part (CSWP) is a new feature in SharePoint 2013. It can be most accurately compared to the Content Query Web Part that we have in previous SharePoint versions. The one striking difference between Content Search and Content Query is that Content Search allows you to query and show information from any site collection. As long as your search is configured to crawl the information it can be pulled into your CSWP!
This blog covers a basic scenario that will show you how easily the CSWP can be configured and ready for use.
Scenario – A research organization is putting together a SharePoint 2013 Community site to enable all of its top scientists to communicate. It would like to have a section on the site that shows all the organization’s scientists in a functional image slider. The problem is that the photos are spread throughout the site collection in different libraries. The one positive is that the organization uses Enterprise Keywords and all the photos have been tagged with the keyword Scientist. (At the end of this blog, I will show how to activate Enterprise Keywords on a library.)
Here are the steps the organization will follow:
1- The first step is to edit my Community site and add my CSWP which can be found in the Content Rollup category.
2- To configure the web part first click anywhere in the web part, then choose the Web Part tab in the ribbon. From that tab click Web Part Properties

3- We first need to setup the query. To do so click Change query from the web part properties box.
4- A Build Your Query dialog box will open. There are four tabs available Basics, Refiners, Settings and Test. From the Basics tab you should see Switch to Advanced Mode in the upper right corner. If you see Switch to Quick Mode click it. We will start this query from the Quick mode.


5- From the Select a query menu I have several options. In this situation I could either choose Items matching a tag (System) orPictures (System).  I also have the option of just querying documents, items matching a specific content type, popular items, etc.
6- Under Restrict by app I can decide to query the Current Site Collection, Current Site, Specific URL, or I can choose Don’t restrict results by app and query everything that I am currently crawling.
7- If you remember, in my test scenario I am looking for items that have a specific keyword of Scientist. So here I will choose Restrict on this tag: and enter Scientist.
8- You can add additional filters here or Switch to Advanced Mode for even more options. On the right hand side you can see what your query is currently returning to the web part.
9- The Refiners tab will allow you to filter your query even further. Currently, my query is returning any item that has been tagged with the keyword Scientist, but let’s say in my results I am finding that some documents had also been tagged with that keyword. I only want images to display so I can use this tab to add the ContentType of Picture to my refiners.
10- The Settings tab has a few additional options including the use of Query rules and the loading behavior of your query. For this example I will leave everything at the default.
11- The tab Test gives you your final query text for testing purposes. When finished simply click OKat the bottom of the Build Your Query dialog box.
12- The final step is to setup how results will display. From the Web Part Properties box you have the following options (the settings I choose for this solution can be seen in the image below.)
  • Number of items to show
  • Under Display Templates: Control (List, List with Paging or Slideshow)
  • Under Display Templates: Item (determines how the image and text will display, if you are just listing documents “two lines” would be the best option)
  • Under Display Templates: Don’t show anything when there are no results (leave this checked to avoid blank space, especially when using the slideshow control.)
**Note- If you want to get your hands on the code behind these display templates they can be found under Site Settings > Web Designer Galleries > Master pages > Display Templates > Content Web Parts
When your settings are right click OK to close your web part and you’re done!