0% found this document useful (0 votes)
111 views

Developing Microsoft SharePoint Server 2

Uploaded by

Rabah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
111 views

Developing Microsoft SharePoint Server 2

Uploaded by

Rabah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 132

O F F I C I A L M I C R O S O F T L E A R N I N G P R O D U C T

20489B
Developing Microsoft® SharePoint® Server
2013 Advanced Solutions    
Information in this document, including URL and other Internet Web site references, is subject to change
without notice. Unless otherwise noted, the example companies, organizations, products, domain names,
e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with
any real company, organization, product, domain name, e-mail address, logo, person, place or event is
intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the
user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in
or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical,
photocopying, recording, or otherwise), or for any purpose, without the express written permission of
Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property
rights covering subject matter in this document. Except as expressly provided in any written license
agreement from Microsoft, the furnishing of this document does not give you any license to these
patents, trademarks, copyrights, or other intellectual property.

The names of manufacturers, products, or URLs are provided for informational purposes only and
Microsoft makes no representations and warranties, either expressed, implied, or statutory, regarding
these manufacturers or the use of the products with any Microsoft technologies. The inclusion of a
manufacturer or product does not imply endorsement of Microsoft of the manufacturer or product. Links
may be provided to third party sites. Such sites are not under the control of Microsoft and Microsoft is not
responsible for the contents of any linked site or any link contained in a linked site, or any changes or
updates to such sites. Microsoft is not responsible for webcasting or any other form of transmission
received from any linked site. Microsoft is providing these links to you only as a convenience, and the
inclusion of any link does not imply endorsement of Microsoft of the site or the products contained
therein.
© 2013 Microsoft Corporation. All rights reserved.

Microsoft and the trademarks listed at


http://www.microsoft.com/about/legal/en/us/IntellectualProperty/Trademarks/EN-US.aspx are trademarks of
the Microsoft group of companies. All other trademarks are property of their respective owners

Product Number: 20489B

Released: 11/2013
Creating Robust and Efficient Apps for SharePoint 1-1

Module 1
Creating Robust and Efficient Apps for SharePoint
Contents:
Lesson 1: Apps for SharePoint 2 

Lesson 2: Communicating with SharePoint from an App 5 

Lesson 3: Authenticating and Authorizing Apps for SharePoint 7 


Module Review and Takeaways 9 
1-2 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 1
Apps for SharePoint
Contents:
Resources 3
Demonstration: Exploring an App Package 3
Creating Robust and Efficient Apps for SharePoint 1-3

Resources
Fundamentals of Apps for SharePoint

Additional Reading: For more information on hosting models, see Choose patterns for
developing and hosting your app for SharePoint at
http://go.microsoft.com/fwlink/?LinkId=320734
Additional Reading: For more information on app webs and host webs, including app
prefixes and app IDs, see Host webs, app webs, and SharePoint components in SharePoint 2013 at
http://go.microsoft.com/fwlink/?LinkId=320735

Demonstration: Exploring an App Package


Demonstration Steps
1. Explore the contents of the SiteSuggestionsApp project. Point out that the app contains:

a. Site columns named Feedback, Positive, and SuggestionLookup.

b. Content types named Suggestion and Vote.


c. List instances named Suggestions and Votes.

2. In Solution Explorer, double-click AppManifest.xml.

3. Review the contents of the app manifest, noting in particular the Start page setting.

4. On the DEBUG menu, click Start Debugging.

5. If you are prompted for credentials, log in as CONTOSO\Administrator with password Pa$$w0rd.

6. On the Site Suggestions page, in the Subject box, type the title of a suggestion.
7. In the Feedback box, type a sentence, and then click Submit Suggestion.

8. Below Here are the current suggestions, click the title of your suggestion.

9. In the text area, click Like.

10. In the Message from webpage dialog box, click OK.

11. Close Internet Explorer.

12. In Visual Studio, on the BUILD menu, click Publish.


13. In the Publish apps for Office and SharePoint dialog box, click Finish.

14. In File Explorer, right-click SiteSuggestionsApp.app, and then click Rename.

15. Append .zip to the file extension, and then press Enter.

16. In the Rename dialog box, click Yes.

17. Right-click SiteSuggestionsApp.app.zip, and then click Extract All.

18. In the Extract Compressed (Zipped) Folders dialog box, click Extract.

19. Point out that, among other things, the app package contains an app manifest file (AppManifest.xml),
and a SharePoint solution package (SiteSuggestionsApp.wsp).

20. In the SiteSuggestionsApp.app window, double-click AppManifest.xml.


21. In the How do you want to open this type of file (.xml)? dialog box, click Notepad.
1-4 Developing Microsoft SharePoint Server 2013 Advanced Solutions

22. Review the contents of the published app manifest, and then close the file.

23. In the SiteSuggestionsApp.app window, right-click SiteSuggestionsApp.wsp, and then click


Rename.

24. Append .cab to the file extension, and then press Enter.

25. In the Rename dialog box, click Yes.

26. Double-click SiteSuggestionsApp.wsp.cab.

27. Explore the contents of the solution package. Point out that the solution package contains all the
resources that are deployed to the app web, including pages, JavaScript files, CSS files, a Feature.xml
file, and feature manifests for each of the declarative components (site columns, content types, and
list instances).

28. Close all open windows.


Creating Robust and Efficient Apps for SharePoint 1-5

Lesson 2
Communicating with SharePoint from an App
Contents:
Resources 6
1-6 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Resources
Developing Robust JavaScript Code

Additional Reading: For more information on strict mode, see Strict Mode (JavaScript) at
http://go.microsoft.com/fwlink/?linkId=320736
Creating Robust and Efficient Apps for SharePoint 1-7

Lesson 3
Authenticating and Authorizing Apps for SharePoint
Contents:
Resources 8
1-8 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Resources
Requesting Permissions

Additional Reading: For a comprehensive list of Scope URI values and the corresponding
available rights, see App permissions in SharePoint 2013 at
http://go.microsoft.com/fwlink/?LinkId=320738
Creating Robust and Efficient Apps for SharePoint 1-9

Module Review and Takeaways


Review Question(s)
Question: Which two service applications must be installed on a SharePoint 2013 server farm before you
can deploy and use apps for SharePoint?

Answer: The App Management Service and the Subscription Settings Service.

Question: True or false: the REST API supports only CRUDQ data operations.

( ) True

( ) False

Answer:

( ) True

(√) False

Question: When you install an app for SharePoint, you must grant it all of the permissions it requests or
cancel the installation. Why does SharePoint not allow you to grant permissions selectively to apps?

Answer: It helps to ensure the app will function as expected.

Question: When you develop an app for SharePoint, at what points in your code should you consider
requesting a health score from the SharePoint server?

Answer: You should consider requesting a health score before you submit requests that may
demand a large amount of server resources, such as large list queries.
Developing Managed Metadata Solutions 2-1

Module 2
Developing Managed Metadata Solutions
Contents:
Lesson 2: Configuring Managed Metadata Term Sets 2 

Module Review and Takeaways 5 


2-2 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 2
Configuring Managed Metadata Term Sets
Contents:
Demonstration: Building a Term Set with the Server-Side Object Model 3
Developing Managed Metadata Solutions 2-3

Demonstration: Building a Term Set with the Server-Side Object Model


Demonstration Steps
1. In Solution Explorer, right-click References, and then click Add Reference.

2. In the Reference Manager - TermSetCreator dialog box, under Assemblies, click Extensions.

3. In the list of assemblies, click Microsoft.SharePoint, and then select the check box that appears.

4. In Solution Explorer, double-click Program.cs, and then locate the following line of code:

using System.Threading.Tasks;

5. Immediately after the located code, insert the following lines of code:

using Microsoft.SharePoint;

6. Locate the following line of code:

//Connect to the taxonomy session here

7. Replace the located code with the following line of code:

8. Locate the following line of code:

//Get the term stores here

9. Replace the located code with the following code:

10. Locate the following line of code:

//Get the first term store here

11. Replace the located code with the following line of code:
12. Locate the following line of code:

//Get the Vehicles group here

13. Replace the located code with the following line of code:

14. Locate the following line of code:

//Create a vehicles group here

15. Replace the located code with the following line of code:

16. Locate the following line of code:

//Get the Cars term set here

17. Replace the located code with the following line of code:

18. Locate the following line of code:

//Create the Cars term set here

19. Replace the located code with the following line of code:
2-4 Developing Microsoft SharePoint Server 2013 Advanced Solutions

20. Locate the following line of code:

//Create a term here

21. Replace the located code with the following line of code:

22. Locate the following line of code:

//Commit the changes to the term store here

23. Replace the located code with the following line of code:

24. On the DEBUG menu, click Start Debugging.

25. On the Windows Start screen, type SharePoint, and then click SharePoint 2013 Central
Administration.

26. Under Application Management, click Manage service applications.


27. On the Term Store Management Tool page, expand the Vehicles group.
Developing Managed Metadata Solutions 2-5

Module Review and Takeaways


Review Question(s)
Question: The marketing team has created the term "Sales Lead" in the Marketing term set. The sales
team wants to use the same term in the Sales term set. When sales personnel make changes to the new
term, you do not want those changes to apply to the term in the Marketing term set. How can you satisfy
this requirement?

Answer: Copy the "Sales Lead" term and then move it to the Sales term set.

Question: True or False: When you create a managed metadata site column, you can control the term set
that users pick terms from.

( ) True

( ) False

Answer:
(√) True

( ) False
Interacting with the Search Service 3-1

Module 3
Interacting with the Search Service
Contents:
Lesson 1: Understanding the SharePoint 2013 Search Service 2 

Lesson 2: Building Search Queries with KQL and FQL 6 

Lesson 3: Executing Search Queries from Code 8 


Module Review and Takeaways 11 
3-2 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 1
Understanding the SharePoint 2013 Search Service
Contents:
Resources 3
Demonstration: Exploring the Search Architecture 3
Demonstration: Exploring Crawl and Managed Properties 4
Demonstration: Exploring the Search Schema 4
Interacting with the Search Service 3-3

Resources
Crawled Properties

Additional Reading: For more information on the


SPEnterpriseSearchMetadataCrawledProperty cmdlet, see New-
SPEnterpriseSearchMetadataCrawledProperty at http://go.microsoft.com/fwlink/?LinkId=321929.

Managed Properties

Additional Reading: For more information on how to create managed properties by using
Windows PowerShell, see New-SPEnterpriseSearchMetadataManagedProperty at
http://go.microsoft.com/fwlink/?LinkId=321930.

Demonstration: Exploring the Search Architecture


Demonstration Steps
1. Start the 20489B-LON-SP-03 virtual machine.
2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Start screen, type SharePoint, and then click SharePoint 2013 Central Administration.

4. On the Central Administration web site, under Application Management, click Manage service
applications

5. On the Manage Service Applications page, in the Search Service Application row, click Contoso
Search.
6. Review the Search Administration page. Point out the Search Application Topology section and
how each role is assigned to a single server. Also point out how you cannot change the topology by
using the administration web site in SharePoint 2013; this must be done by using Windows
PowerShell.

7. Right-click the taskbar, and then click Task Manager

8. In the Task Manage dialog box, click More details. On the Details tab, review the processes that are
running as noderunner.exe.

9. On the Start screen, type Services, and then click Services.

10. In the Services window, right-click SharePoint Search Host Controller, and then click Stop.

11. Switch to SharePoint Central Administration.

12. Press F5 to refresh the page.

13. Under Search Application Topology, point out that the admin component is not running.
14. Switch to Task Manager.

15. Notice how all the noderunner.exe processes have been removed.

16. Switch to the Services window.

17. Right-click SharePoint Search Host Controller, and then click Start.

18. Switch to SharePoint Central Administration.


3-4 Developing Microsoft SharePoint Server 2013 Advanced Solutions

19. Press F5 until you see the services slowly come back up under Search Application Topology.

20. Switch to Task Manager. You should now see the noderunner.exe processes have started again.

21. Close all open windows.

Demonstration: Exploring Crawl and Managed Properties


Demonstration Steps
1. Start the 20489B-LON-SP-03 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Start screen, type SharePoint, and then click SharePoint 2013 Central Administration.

4. On the Central Administration web site, under Application Management, click Manage service
applications.
5. On the Manage Service Application page, click Contoso Search.

6. In the Quick Launch menu, under Queries and Results, click Search Schema.

The default view will show managed properties.

7. In the Filter section, in the Managed property box, type author, and then click apply.

8. In the Managed Properties list, click the Author managed property.

9. On the Edit Managed Property - Author page, review each of the settings for the managed
property.

10. Specifically notice the Mappings to crawled properties section and how there are several mapped to
this single managed property, and then click OK.

11. In the navigation at the top of the page, click the Crawled Properties link.

12. In the Filters section, in the Category list, click People.

13. In the Crawled properties box, type name, and then click apply.
14. In the Crawled properties list, click the People:AccountName crawled property.

15. In the Include in full-text index section, select the Include in full-text index check box, and then
click OK.
16. In the navigation at the top of the page, click the Categories link.

17. You should be presented with a list of crawled property categories, and how many exist in each
category.

18. Close Internet Explorer.

Demonstration: Exploring the Search Schema


Demonstration Steps
1. Start the 20489B-LON-SP-03 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.


3. On the Start screen, click Internet Explorer.

4. In the Address bar, type http://search.contoso.com, and then press Enter.

5. Click the Settings icon, and then click Site settings.


Interacting with the Search Service 3-5

6. Under Search, click Schema. Notice that you have no ability to create a managed property at this
level.
7. Click Back to Site Settings.

8. Under Search, click Result Sources.

9. On the Manage Result Sources page, click New Result Source.

10. On the Add Result Source page, in the Name box, type Tasks (Site), and then click Save.

11. On the Manage Result Sources page, click the Settings icon, and then click Site settings.

12. Under Site Collection Administration, click Search Schema.


13. On the Site Collection Administration - Managed Properties page, click New Managed Property.

14. On the New Managed Property page, in the Property name box, type Classification.

15. In the Type section, observe that you can only add Text and Yes/No property types. Review the rest
of the page and observe that you cannot specify multiple values and you cannot add it as a refiner or
sortable managed property. Click OK.

16. On the Site Collection Administration - Managed Properties page, click the Settings icon, then
click Site settings.

17. Under Site Collection Administration, click Search Result Sources. Notice that the Tasks (Site)
result type is not visible.

18. On the Manage Result Source page, click New Result Source.

19. On the Add Result Source page, in the Name box, type Tasks (SiteCol), and then click Save.

20. On the Managed Result Sources page, click the Settings icon, and then click Site settings.

21. Under Site Collection Administration, click Search Schema.

22. On the Site Collection Administration - Managed Properties page, in the Managed property
box, type Classification, and then click apply. You should now see your site collection property in
the Managed Properties list.

23. Click the Settings icon, and then click Site settings.

24. Under Search, click Result Sources. In the Result Sources list you should see the Tasks (SiteCol) site
collection result source.

25. On the Start screen, type SharePoint, and then click SharePoint 2013 Central Administration.

26. Under Application Management, click Manage service applications.

27. On the Manage Service Application page, click Contoso Search.

28. On the Quick Launch menu, under Queries and Results, click Result Sources. You should not see
the site collection or site level result sources created previously, as they are out of scope.

29. Close all open windows.


3-6 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 2
Building Search Queries with KQL and FQL
Contents:
Resources 7
Interacting with the Search Service 3-7

Resources
FAST Query Language (FQL) Queries

Additional Reading: For more information on FAST Query Language, see FAST Query
Language (FQL) syntax reference at http://go.microsoft.com/fwlink/?LinkId=321932.
3-8 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 3
Executing Search Queries from Code
Contents:
Resources 9
Demonstration: Server Side Object Model 9
Demonstration: Client Side Object Model 9
Demonstration: Executing FQL Queries 10
Interacting with the Search Service 3-9

Resources
Executing Server-Side Queries

Additional Reading: For more information on the properties available in the


KeywordQuery class, see KeywordQuery class at http://go.microsoft.com/fwlink/?LinkId=321934.

Executing Representational State Transfer (REST) Queries

Additional Reading: For more information on the available properties and endpoints, see
SharePoint Search REST API overview at http://go.microsoft.com/fwlink/?LinkId=321935.

Demonstration: Server Side Object Model


Demonstration Steps
1. Start the 20489B-LON-SP-03 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.


3. On the Start screen, click Computer.

4. In File Explorer, browse to E:\Democode\SearchWinApp, and then double-click SearchWinApp.sln.

5. In the How do you want to open this type of file (.sln)? dialog box, click Microsoft Visual Studio
Version Selector.

6. In Solution Explorer, right-click Form1.cs, and click View Code.

7. In the Form1.cs code file, review the button1_Click method. Notice that the calls are being made by
using the Server Side Object Model. Also point out the possibility of getting back multiple result
tables.

8. On the DEBUG menu, click Start Debugging.


9. In the Form1 window, in the text box, type Contoso, and then click Search. You should get results
back in the grid view. Please note that this may take some time.

10. Close all open windows.

Demonstration: Client Side Object Model


Demonstration Steps
1. Start the 20489B-LON-SP-03 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Start screen, click Computer.

4. In File Explorer, browse to E:\Democode\SearchClientApp, and then double-click


SearchClientApp.sln.

5. In Solution Explorer, right-click Form1.cs, and then click View Code.

6. In the Form1.cs code page, review the button1_Click method. Notice that the calls are being made
by using the Client Side Object Model classes that look exactly like the service-side object model. Also
point out the possibility of getting multiple result tables back.
3-10 Developing Microsoft SharePoint Server 2013 Advanced Solutions

7. On the DEBUG menu, click Start Debugging.

8. In the Form1 window, in the text box, type Contoso, and then click Search. You should get results
back in the grid view. Please note that this may take some time.

9. Close all open windows.

Demonstration: Executing FQL Queries


Demonstration Steps
1. Start the 20489B-LON-SP-03 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Start screen, click Internet Explorer.

4. In the Address bar, type the following URL, and then press Enter:

http://search.contoso.com/_api/search/query?querytext='Sharepoint'&enablefql=true

5. Notice that you receive an HTTP 500 error. This is because the default result source has a KQL query
expression as its query transform.

6. On the Start screen, type SharePoint, and then click SharePoint 2013 Central Administration.
7. Under Application Management, click Manage service applications.

8. On the Manage Service Applications page, click Contoso Search.

9. On the Quick Launch menu, under Queries and Results, click Result Sources.

10. On the Manage Result Sources page, click New Result Source.

11. On the Add Result Source page, in the Name box, type FQL.

12. In the Query Transform section, clear the Query Transform text box, and then click Save.
13. On the Manage Result Sources page, under Defined for this search service (1), point to FQL, click
the drop-down arrow, and then click Set as Default.

14. Switch to the other browser window.

15. Press F5 to refresh the page. You should now see results using the FQL query.

16. Switch to the other browser window.

17. On the Manage Result Sources page, under Provided by SharePoint (16), point to Local
SharePoint Results, click the drop-down arrow, and then click Set as Default.

18. Close all open windows.


Interacting with the Search Service 3-11

Module Review and Takeaways


Review Question(s)
Question: Which of the following is not run by the NodeRunner.exe process?

( ) Administration

( ) Content Processing

( ) Analytics

( ) Crawler

( ) Index

Answer:

( ) Administration

( ) Content Processing

( ) Analytics
(√) Crawler

( ) Index

Question: Which of the following search queries will return all Word documents modified after 1/1/2013?
( ) Docx AND 1/1/2013

( ) Title:Docx AND 1/1/2013

( ) FileType:Docx AND Modified>=1/1/2013


( ) FileType:Word AND Write>=1/1/2013

( ) FileType:Docx And Write <=1/1/2013

Answer:
( ) Docx AND 1/1/2013

( ) Title:Docx AND 1/1/2013

( ) FileType:Docx AND Modified>=1/1/2013


(√) FileType:Word AND Write>=1/1/2013

( ) FileType:Docx And Write <=1/1/2013


3-12 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Question: What is the maximum query length of a search query when using the user interface?

( ) 1,024

( ) 512

( ) 2,048

( ) 4,096

( ) 256

Answer:

( ) 1,024

( ) 512

(√) 2,048

( ) 4,096
( ) 256

Question: What permission does an App for SharePoint need in order to execute search queries?

( ) Search, QueryAsUserIgnoreAppPrincipal
( ) Web, FullControl

( ) Site Collection, FullControl

( ) Enterprise Resources, Read


( ) Tenant, FullControl

Answer:

(√) Search, QueryAsUserIgnoreAppPrincipal


( ) Web, FullControl

( ) Site Collection, FullControl

( ) Enterprise Resources, Read


( ) Tenant, FullControl
Customizing the Search Experience 4-1

Module 4
Customizing the Search Experience
Contents:
Lesson 1: Customizing Query Processing 2 

Lesson 2: Customizing Search Results 5 

Lesson 3: Customizing Content Processing 8 


Module Review and Takeaways 10 

Lab Review Questions and Answers 12 


4-2 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 1
Customizing Query Processing
Contents:
Demonstration: Creating Result Sources with Query Transforms 3
Demonstration: Query Rules 3
Customizing the Search Experience 4-3

Demonstration: Creating Result Sources with Query Transforms


Demonstration Steps
1. Start the 20489B-LON-SP-04 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Windows Start page, click Internet Explorer.

4. In the address bar, type http://team.contoso.com, and then press Enter.

5. On the Contoso Team Site home page, click Settings, and then click Site settings.

6. Under Site Collection Administration, click Search Result Sources.

7. On the Manage Result Sources page, click New Result Source.

8. In the Name box, type My Custom Source.


9. Point out that you are not setting the Query template, and then click Save.

10. On the Windows Start page, click Computer.

11. In File Explorer, browse to E:\Democode\CreateQueryTransform, and then double-click


CreateQueryTransform.sln.

12. In the How do you want to open this type of file (.sln) dialog box, click Visual Studio 2012.

13. In Visual Studio, in Solution Explorer, double-click Program.cs. Review the code, point out each of
the steps that are required to get a Search context, and also that this result source is scoped at a site
collection level. Note the way to create the QueryTransformProperties object. Be sure to mention
that after all items have been set, you make a call to Commit to save your changes.
14. On the DEBUG menu, click Start Debugging.

15. Switch to Internet Explorer.

16. Click the My Custom Source result source. Point out that the Query template is now populated, and
then click Launch Query Builder.

17. In the Build Your Query dialog box, click the SORTING tab, point out that the sort is now based on
the LastModifiedTime in descending order, and then click Cancel.

18. Close Internet Explorer, and then close Visual Studio.

Demonstration: Query Rules


Demonstration Steps
1. Start the 20489B-LON-SP-04 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.


3. On the Windows Start page, click Internet Explorer.

4. In the address bar, type http://search.contoso.com, and then press Enter.

5. Click Settings, and then click Site settings.

6. Under Site Collection Administration, click Search Query Rules.

7. On the Manage Query Rules page, in the Select a Result Source list, click Local SharePoint
Results (System).

8. Click New Query Rule.


4-4 Developing Microsoft SharePoint Server 2013 Advanced Solutions

9. On the Add Query Rule page, in the Rule name box, type SharePoint.

10. Click the Context link to expand the context configuration section.

11. Under Query is performed on these sources, click All sources.

12. In the Query Conditions section, in the Query exactly matches one of these phrases (semi-colon
separated) box, type SharePoint.
13. In the Actions section, click the Add Promoted Result link.

14. In the Add Promoted Result dialog box, in the Title box, type Microsoft SharePoint.

15. In the URL box, type http://www.microsoft.com/sharepoint, and then click Save.

16. On the Add Query Rule page, click the Publishing link to expand the publishing section.

17. For the Start Date, click the calendar icon, and then click today’s date.

18. For the End Date, click the calendar icon, click one week from today, and then click Save.
19. Click the Contoso Search link.

20. On the Search homepage, in the text box, type SharePoint, and then press Enter. You should see the
promoted result at the top of the page.

21. Close Internet Explorer.


Customizing the Search Experience 4-5

Lesson 2
Customizing Search Results
Contents:
Demonstration: Display Templates 6
Demonstration: Creating and Configuring Refiners 6
4-6 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Demonstration: Display Templates


Demonstration Steps
1. Start the 20489B-LON-SP-04 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Windows Start page, click Internet Explorer.

4. In the address bar, type http://search.contoso.com, and then press Enter.

5. Click Settings, and then click Site settings.

6. Under Site Collection Administration, click Search Result Types

7. On the Manage Result Types page, click New Result Type.

8. On the Add Result Type page, in the Give it a name box, type Word Documents.
9. Click Show more conditions to expand the advanced conditions area.

10. In the Which custom properties should match? list, click FileType.

11. In the Enter value for property box, type doc.

12. Click the Add value link.

13. In the Enter value for property box, type docx.

14. In the What should these result look like? list, click Office Document Item, and then click Save.
15. Close Internet Explorer.

Demonstration: Creating and Configuring Refiners


Demonstration Steps
1. Start the 20489B-LON-SP-04 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.


3. On the Windows Start page, type SharePoint, and then click SharePoint 2013 Central
Administration.

4. Under Application Management, click Manage service applications.

5. Click Contoso Search.

6. In the quick launch section, under Queries and Results, click Search Schema.

7. In the Managed property box, type Author, and then press Enter.

8. Click the DisplayAuthor managed property.

9. Note the Refinable property is set to Yes - active; this allows the property to be used as a refiner

10. Open a new browser tab, in the address bar, type http://search.contoso.com, and then press Enter.
11. On the Search home page, in the text box, type SharePoint, and then press Enter.

12. On the results page, click Settings, and then click Edit page.

13. In the Navigation Zone section, click the Refinement Web Part Menu drop-down arrow, and then
click Edit Web Part.

14. In the Refinement section, click the Choose Refiners button.


Customizing the Search Experience 4-7

15. In the Refinement configuration for ‘Refinement’ dialog box, there is a list of all available
managed properties for use as a refiner. You should also see the default set of refiners, including the
DisplayAuthor managed property.

16. In the Selected refiners list, click DisplayAuthor, and notice how the configuration area changes.

17. In the Display name box, type Author, and then click OK.

18. Close all open windows.


4-8 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 3
Customizing Content Processing
Contents:
Resources 8
Customizing the Search Experience 4-9

Resources
Creating and Deploying a Thesaurus

Reference Links: For more information on the supported languages, see Create and
deploy a thesaurus in SharePoint Server 2013 at http://go.microsoft.com/fwlink/?LinkId=321936
4-10 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Module Review and Takeaways


Review Question(s)
Question: What web part do you configure to show data from a specific result source on a typical search
result page?

( ) Search Results

( ) Content Query

( ) Refinement

( ) Search Textbox

( ) Search Navigation

Answer:

(√) Search Results

( ) Content Query
( ) Refinement

( ) Search Textbox

( ) Search Navigation

Question: Which of the following is implemented by using managed metadata?

( ) Entity extractors

( ) Thesaurus
( ) Content Enrichment Service

( ) Display Template

( ) Company Name Extractor


Answer:

( ) Entity extractors

( ) Thesaurus

( ) Content Enrichment Service

( ) Display Template

(√) Company Name Extractor

Question: True or False: You can create result types at the Service Application level.

( ) True

( ) False
Answer:

( ) True

(√) False
Customizing the Search Experience 4-11

Question: True or False: Setting the refinable property will make the refinement web part display the
refiner in search results.
( ) True

( ) False

Answer:

( ) True

(√) False
4-12 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lab Review Questions and Answers


Lab B: Configuring Entity Extraction
Question and Answers
Lab Review
Question: How many different types of entity extractors are available?

Answer: Four

Question: What must you do after registering the entity extractor file?
Answer: Set up the managed properties to use the entity extractor and then do a full crawl.
Implementing Enterprise Content Management 5-1

Module 5
Implementing Enterprise Content Management
Contents:
Lesson 2: Working with Content Management 2 

Module Review and Takeaways 4 


5-2 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 2
Working with Content Management
Contents:
Demonstration: Creating and Exporting a Policy 3
Implementing Enterprise Content Management 5-3

Demonstration: Creating and Exporting a Policy


Demonstration Steps
1. On the Contoso Development Site page, click the Settings icon, and then click Site settings.

2. On the Policies page, click Create.

3. On the Edit Policy page, in the Name box, type Example Policy.

4. In the Administrative Description box, type This policy is to demonstrate export.

5. Select Enable Retention check box, and then click Add a retention stage.

6. In the Stage properties -- Webpage Dialog dialog box, in the Time Period boxes, enter Created
Date +1 years.

7. Select Enable Barcodes, and then click OK.

8. In the list of policies, click Example Policy.

9. Scroll to the bottom of the page, and then click Export.

10. In the Do you want to open or save Example Poilcy.xml from dev.contoso.com? message box,
click Save.

11. In the The Example Poilcy.xml download has completed message box, click Open folder.

12. In the Downloads window, right-click Example Policy.xml, point to Open with, and then click
Choose default program.

13. In the How do you want to open this file? dialog box, clear the Use this app for all .xml files
check box, and then click More options.
5-4 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Module Review and Takeaways


Review Question(s)
Question: You have created an eDiscovery Center and a new eDiscovery Case. However, when you create
a set and try to access results within the set, you receive an error. You also cannot create queries on the
set. How can you solve this problem?

Answer: Configure the Search Service and run a full index.

Question: True or False: When you enable the Content Organizer in a site, users must always add their
documents to the Drop-Off Library.

( ) True

( ) False

Answer:

( ) True
(√) False
Developing a Publishing Site for Web Content 06-1

Module 6
Developing a Publishing Site for Web Content
Contents:
Lesson 1: Programming with the Web Content Publishing API 2 

Lesson 2: Developing Page Components for Web Content Publishing 4 

Module Review and Takeaways 7 


06-2 Developing Microsoft SharePoint 2013 Advanced Solutions

Lesson 1
Programming with the Web Content Publishing API
Contents:
Resources 3
Developing a Publishing Site for Web Content 06-3

Resources
Working with Navigation Settings

Additional Reading: For more information on programming the


Microsoft.SharePoint.Publishing.Navigation.PortalNavigation class, read the class documentation
on MSDN at http://go.microsoft.com/fwlink/?LinkId=321107.
Additional Reading: For more information on programming the
Microsoft.SharePoint.Publishing.WebNavigationSettings class, read the class documentation on
MSDN at http://go.microsoft.com/fwlink/?LinkId=321108.
06-4 Developing Microsoft SharePoint 2013 Advanced Solutions

Lesson 2
Developing Page Components for Web Content
Publishing
Contents:
Resources 5
Demonstration: Deploying a ScriptLink Custom Action 5
Developing a Publishing Site for Web Content 06-5

Resources
Working with Field Controls

Best Practice: It is generally recommended to deploy custom files to the SharePoint root
folder path under a solution-specific sub-folder in order to separate out-of-box files from custom
solutions. In the case of rendering templates, SharePoint will only inspect the root folder, and will
not search child folders. User control files containing rendering templates must be deployed to
the root folder. To reduce the risk of file naming conflicts, you should prefix your user control file
names with a solution-specific identifier.

Working with Web Parts

Best Practice: It is recommended that when embedding a web part in page layouts or
pages, that the part always be contained in a web part zone. The exception to this rule is when
adding web parts to a master page that does not support web part zones.
Additional Reading: For more information about Web Part Zones, read the WebPartZone
Class documentation on MSDN at http://go.microsoft.com/fwlink/?LinkId=321110.
Additional Reading: For a description of the standard properties available on all web
parts, read about the WebPart Class on MSDN at http://go.microsoft.com/fwlink/?LinkId=321111.

Working with ScriptLink Custom Actions

Additional Reading: You can find out more about the ScriptLink class on MSDN at
http://go.microsoft.com/fwlink/?LinkId=235313.

Demonstration: Deploying a ScriptLink Custom Action


Demonstration Steps
1. Connect to the 20489B-LON-SP-06 virtual machine.

2. If you are not already logged on, log on to the LONDON machine as CONTOSO\Administrator with
password Pa$$w0rd.

3. On the Windows Start page, click Computer.

4. In File Explorer, browse to E:\DemoCode\ScriptLinks, and then double-click


Contoso.WebControls.CustomActions.sln.

5. In the How do you want to this this type of file (.sln)? dialog box, click Visual Studio 2012.

6. In Visual Studio, in Solution Explorer, expand the Contoso.WebControls.CustomActions project


node, expand the Layouts folders, and then expand the Scripts folder.

7. Point out that the jQuery-1.7.1.min.js is being deployed to the SharePoint file system. Note that this
location will allow the file to be accessed by using the virtual path "_layouts".

8. Expand the ScriptLinks folder, and then double-click the Elements.xml file.
9. Point out the two custom actions. Note that one custom action is using the ScriptSrc property to
insert a script link tag, and the other is using a ScriptBlock property to insert a snippet of JavaScript.
06-6 Developing Microsoft SharePoint 2013 Advanced Solutions

10. Note that the custom action with the lower sequence number of 150 will be inserted before the
higher sequence number of 151.
11. Expand the Features folder, and then double-click on the ScriptLinks feature.

12. In Feature Designer, note that the Scope is Site.

13. On the DEBUG menu, click Start Without Debugging.

14. Note that the script block has executed when the alert dialog is displayed in Internet Explorer.

15. In the Message from webpage dialog box, click OK.

16. Close Internet Explorer.


17. In Visual Studio, in the Features folder, double-click the ScriptLinks feature.

18. In Feature Designer, in the Scope list, click WebApplication.

19. On the FILE menu, click Save All.

20. On the DEBUG menu, click Start Without Debugging.

21. Note that the script block is still executed on the site. Explain that the script links will now be inserted
on every site contained in the web application.

22. In the Message from webpage dialog box, click OK.

23. Close Internet Explorer.

24. In Visual Studio, on the BUILD menu, click Retract.

25. Wait for the retractions process to complete, and then close Visual Studio.
Developing a Publishing Site for Web Content 06-7

Module Review and Takeaways


Review Question(s)
Question: Which of the following objects does not support the JSLink Property? (Select one)

( ) SPField

( ) SPView

( ) BaseFieldControl

( ) SPContentType

( ) ListFormWebPart

Answer:

( ) SPField

( ) SPView

(√) BaseFieldControl
( ) SPContentType

( ) ListFormWebPart

Question: Can Publishing Page Layouts or Pages be provisioned from a SharePoint App by using a
Schema Element?

( ) True

( ) False
Answer:

( ) True

(√) False
Question: What is the purpose of the EditModePanel control in a Page Layout?

Answer: Controls contained within the panel are displayed only when the page is in edit mode.

Question: Are Delegate controls supported in SharePoint Apps?

( ) True

( ) False

Answer:

( ) True

(√) False
06-8 Developing Microsoft SharePoint 2013 Advanced Solutions

Question: Compare and contrast the Solution and Features Framework versus the Apps for SharePoint
model. What are some of the limitations in the Apps for SharePoint model that specifically related to Web
Content Management

 Answer: The AppWeb does not support publishing features.

 Provisioning publishing artifacts to the HostWeb requires programming with the CSOM (Schema
Elements are not supported).

 Many types of publishing controls cannot be customized and are not supported by SharePoint Apps.

 The REST API does not support the Publishing API.


Structuring and Publishing Websites for All Users 07-1

Module 7
Structuring and Publishing Websites for All Users
Contents:
Lesson 3: Publishing to Mobile Devices 2 

Lesson 4: Multi-Language Sites Using Variations 4 

Module Review and Takeaways 6 


07-2 Developing Microsoft SharePoint 2013 Advanced Solutions

Lesson 3
Publishing to Mobile Devices
Contents:
Resources 3
Demonstration: Defining Device Channels 3
Structuring and Publishing Websites for All Users 07-3

Resources
Mobile Device Capabilities

Additional Reading: For comprehensive guidance on supported mobile device browsers,


see Mobile device browsers supported in SharePoint 2013 at
http://go.microsoft.com/fwlink/?LinkId=293853.

Demonstration: Defining Device Channels


Demonstration Steps
1. Start the 20489B-LON-SP-07 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Windows Start page, click Internet Explorer.


4. In Internet Explorer, in the address bar, type http://intranet.contoso.com, and then press Enter.

5. Click the Settings icon, and then click Design Manager.

6. On the Design Manager: Welcome page, in the numbered list, click 2. Manage Device Channels.

7. On the Design Manager: Manage Device Channels page, click Create a channel.

8. In the Device Channels - New Item dialog box, in the Name box, type Windows Phone.

9. In the Alias box, type WindowsPhone.


10. In the Description box, type The WindowsPhone device channel.

11. In the Device Inclusion Rules box, type Windows Phone.

12. Select the Active check box, and then click Save.

13. In the Device Channels - New Item dialog box, click Close dialog.

14. Close Internet Explorer.


07-4 Developing Microsoft SharePoint 2013 Advanced Solutions

Lesson 4
Multi-Language Sites Using Variations
Contents:
Resources 5
Structuring and Publishing Websites for All Users 07-5

Resources
Variation Labels

Additional Reading: For more guidance on language packs, see Install or uninstall
language packs for SharePoint 2013 at http://go.microsoft.com/fwlink/?LinkId=141342.

Translating Content

Additional Reading: For more guidance on the XLIFF standard, see OASIS XML Localisation
Interchange File Format (XLIFF) TC at http://go.microsoft.com/fwlink/?LinkId=258217.
07-6 Developing Microsoft SharePoint 2013 Advanced Solutions

Module Review and Takeaways


Review Question(s)
Question: What will be your SharePoint navigation strategy?

Answer: Answers will vary.

Question: True or False: A Search service application is required for cross-site publishing.

( ) True

( ) False

Answer:

(√) True

( ) False

Question: True or False: Variations automatically translate synchronized content.

( ) True
( ) False

Answer:

( ) True
(√) False

Question: What is the maximum number of device channels you can have?

( )2
( )4

( )6

( )8
( ) 10

Answer:

( )2
( )4

( )6

( )8
(√) 10

Question: True or False: Any term set can be used as a navigation term set?

( ) True

( ) False

Answer:

( ) True

(√) False
Structuring and Publishing Websites for All Users 07-7

Question: True or False: Target variations will display in the locale by default.

( ) True

( ) False

Answer:

( ) True

(√) False
Developing Optimized Internet Sites 8-1

Module 8
Developing Optimized Internet Sites
Contents:
Lesson 1: Optimizing a SharePoint Site for Search Engines 2 

Lesson 2: Optimizing Performance and Scalability 5 

Module Review and Takeaways 9 


8-2 Developing Microsoft SharePoint 2013 Advanced Solutions

Lesson 1
Optimizing a SharePoint Site for Search Engines
Contents:
Resources 3
Demonstration: Reading SEO Properties 3
Developing Optimized Internet Sites 8-3

Resources
Generating Sitemaps

Reference Links: SharePoint generates an XML Sitemap by using the Sitemap Protocol that
is supported by most search engines, including Microsoft Bing, Yahoo, and Google. You can find
more information about the Sitemap standard at http://go.microsoft.com/fwlink/?LinkId=320800

Excluding Content from Internet Search

Additional Reading: You can find additional details and formatting examples at
http://go.microsoft.com/fwlink/?LinkId=320801

Demonstration: Reading SEO Properties


Demonstration Steps
1. Start the 20489B-LON-SP-08 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Windows Start page, click Internet Explorer.

4. In Internet Explorer, in the address bar, type http://www.contoso.com, and then press Enter.

5. On the Contoso Pharmaceuticals page, click the Sign In link.

6. Click the Settings icon, and then click Edit page.

7. On the ribbon, click Edit Properties, and then click Edit SEO Properties.

8. On the SEO Properties page, ensure the Name property is set to Home, enter a selection of sample
values for the remaining properties, and then click OK.
9. On the PUBLISH menu, click Publish.

10. In the Publish dialog box, click Continue.

11. On the Windows® Start page, click Computer.


12. In File Explorer, browse to E:\Democode\PowerShell, right-click Get-PageSEOProperties.ps1, and
then click Edit.

13. In Windows PowerShell, note that the code is reading column values on page list items that store SEO
properties.

14. On the File menu, click Run to run the script.

15. Note that the column values match the sample values you entered in a previous step.

Note: The welcome page of a publishing site does not have a Managed Navigation Term
context, so SEO properties are stored as columns on the page item regardless of whether the site
is using Structured or Managed Navigation.

16. In Internet Explorer, in the address bar, type http://www.contoso.com/news.

17. If not already signed in, click the Sign In link.


18. Click the Settings icon, and then click Edit page.
8-4 Developing Microsoft SharePoint 2013 Advanced Solutions

19. On the PAGE menu, click Edit Properties, and then click Edit SEO Properties.

20. On the SEO Properties page, identify that the UI to edit the SEO properties is the same regardless of
whether the site is using Structured or Managed Navigation.

21. Ensure that the Browser Title property is set to News, enter a selection of sample values for the
remaining properties, and then click OK.

22. On the PUBLISH menu, click Publish.

23. In the Publish dialog box, click Continue.

24. In File Explorer, browse E:\Democode\PowerShell, right-click Get-TermSEOProperties.ps1, and


then click Edit.

25. In Windows PowerShell, note that the code is now accessing a NavigationTermSet associated with the
site collection, and reading SEO properties from the NavigationTerm local custom properties
collection.

26. On the File menu, click Run to run the script.

27. Note that the property values match the sample values you entered in the previous step.
28. Close all open windows.
Developing Optimized Internet Sites 8-5

Lesson 2
Optimizing Performance and Scalability
Contents:
Resources 6
Demonstration: Creating and Configuring an Image Rendition 6
8-6 Developing Microsoft SharePoint 2013 Advanced Solutions

Resources
Client-Side Programming

Additional Reading: For more information on programming with the SharePoint 2013
REST API, read Get Started with the SharePoint 2013 REST Service on MSDN at
http://go.microsoft.com/fwlink/?LinkId=320805
Additional Reading: For more information on programming with the SharePoint 2013
JavaScript Object Model, read “How to: Complete basic operations using JavaScript library code
in SharePoint 2013” on MSDN at http://go.microsoft.com/fwlink/?LinkId=320804

Minification and Bundling

Reference Links: Visual Studio® Web Essentials in an extension for Microsoft Visual Studio
2013 that can perform minification and bundling for CSS and JavaScript files. You can down the
extension from http://go.microsoft.com/fwlink/?LinkId=320806

Caching

Additional Reading: For more information, read the Plan for caching and performance in
SharePoint Server 2013 on Microsoft TechNet at http://go.microsoft.com/fwlink/?LinkId=320808

Using Image Renditions

Additional Reading: For more information on working with image renditions, read
SharePoint 2013 Design Manager image renditions on MSDN at
http://go.microsoft.com/fwlink/?LinkId=303705

Using Content Delivery Networks

Best Practice: Despite the implied high-availability of CDNs, in recent years there have
been some very public failures that have impacted the business operations of CDN customers. To
protect your site against potential CDN failures, it is a best practice to include fallback scripts to
local resources.
Reference Links: You can find out more information on the Windows Azure Content
Delivery Network on MSDN at http://go.microsoft.com/fwlink/?LinkId=205043

Demonstration: Creating and Configuring an Image Rendition


Demonstration Steps
1. Connect to the 20489B-LON-SP-08 virtual machine.

2. If you are not already logged on, log on to the LONDON machine as CONTOSO\Administrator with
the password Pa$$w0rd.
3. Open a File Explorer window and browse to C:\inetpub\wwwroot\wss\VirtualDirectories\80.

4. Right-click web.config, point to Open with, and then click Microsoft Visual Studio 2012.
Developing Optimized Internet Sites 8-7

5. In the web.config file, locate the BlobCache element.

6. Review the BlobCache element attributes:

o The location attribute specifies the file system location where files will be cached.

o The path attribute specifies the file types that should be cached, in the form of a regular
expression.
o The maxSize attribute specifies the maximum size of the cache in gigabytes (GB).

o The enabled attribute specifies whether the BLOB cache is enabled.

Note: The BLOB cache is already enabled in the virtual machine to save time during the
demonstration.

7. Close Visual Studio.

8. Open Internet Explorer and browse to http://www.contoso.com.

9. On the Contoso Pharmaceuticals home page, click Sign In.

10. On the Settings menu, click Site settings.

11. On the Site Settings page, under Look and Feel, click Image Renditions.

12. On the Image Renditions page, click Add new item.

13. On the New Image Rendition page, in the Name box, type Landscape Large.

14. In the Width box, type 500.


15. In the Height box, type 400, and then click Save.

16. On the Settings menu, click Site contents.

17. On the Site Contents page, click Site Collection Images.


18. On the Site Collection Images page, click new item.

19. In the Add a document dialog box, browse to E:\Democode\VanGoghStarryNight.jpg, click Open,
and then click OK.

20. In the Site Collection Images – VanGoghStarryNight.jpg dialog box, click Save.

21. On the Site Collection Images page, click All Assets.

22. On the All Assets page, select the VanGoghStarryNight row (click in the column with a checkmark
header).

23. On the ribbon, on the DESIGN tab, click Edit Renditions.

Note: Because you are viewing a newly-uploaded image, SharePoint may take
approximately a minute to generate the renditions.

24. Scroll down the page and briefly review how the image appears in each rendition.

25. Under the Landscape Large rendition, click Click to change.

26. In the Message from Webpage dialog box, click OK.

27. Drag the image handles to resize the selected area. Notice how the resolution stays the same, at 500 x
400 pixels, but you are effectively zooming in on the selected area.
8-8 Developing Microsoft SharePoint 2013 Advanced Solutions

28. Drag the selected area, and notice how the preview image is updated.

Note: The key point here is that the dimensions of the rendition do not change; in this
case, they are fixed at 500 x 400 pixels. However, for individual images, you can configure
whether to scale the whole image down to the size of the rendition, or whether to crop the
image to size, or a combination of the two.

29. Click Cancel, and then close Internet Explorer.


Developing Optimized Internet Sites 8-9

Module Review and Takeaways


Review Question(s)
Question: What is the purpose of the robots.txt file? How is it configured in SharePoint?

 Answer: The robots.txt file supports the Robots Exclusion Protocol, a de facto standard for providing
instructions to Internet search engine crawlers about site paths that should be excluded from search
crawling.

 It is configured in SharePoint by first activating the Search Engine Optimization feature on a Site
Collection, and then editing the Search Engine Sitemap settings found under the Site Collection
Administration group of the top-level site of a Site Collection settings page.

Question: Which type of SharePoint cache is targeted at static resources such as image files?

( ) Page Output Cache

( ) BLOB Cache
( ) Distributed Cache

( ) Session State

( ) Page Cache

Answer:

( ) Page Output Cache

(√) BLOB Cache


( ) Distributed Cache

( ) Session State

( ) Page Cache
Question: Can the use of canonical URLs improve search engine ranking?

( ) True

( ) False
Answer:

(√) True

( ) False
8-10 Developing Microsoft SharePoint 2013 Advanced Solutions

Question: Which optimization technique describes combining multiple source files into a single file?

( ) Minification

( ) Bundling

( ) Image Renditions

( ) Minimal Download Strategy (MDS)

( ) Page Output Caching

Answer:

( ) Minification
(√) Bundling

( ) Image Renditions

( ) Minimal Download Strategy (MDS)

( ) Page Output Caching


Working with Business Connectivity Services 9-1

Module 9
Working with Business Connectivity Services
Contents:
Lesson 1: Business Connectivity Services in SharePoint 2013 2 

Lesson 2: Creating BDC Models in SharePoint Designer 4 

Lesson 3: Creating BDC Models in Visual Studio 2012 8 


Lab Review Questions and Answers 10 
9-2 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 1
Business Connectivity Services in SharePoint 2013
Contents:
Resources 3
Demonstration: Exploring a BDC Model File 3
Working with Business Connectivity Services 9-3

Resources
Overview of Business Connectivity Services

Additional Reading: For more information on the core components of BCS in SharePoint
Server 2013, see Overview of Business Connectivity Services in SharePoint 2013 at
http://go.microsoft.com/fwlink/?LinkId=302076.

Demonstration: Exploring a BDC Model File


Demonstration Steps
1. Connect to the 20489B-LON-SP-09 virtual machine. If you are not already logged on, log in as
CONTOSO\Administrator with password Pa$$w0rd.

2. On the Start screen, type Visual Studio, and then click Visual Studio 2012.

3. On the FILE menu, point to Open, and then click File.

4. In the Open File dialog box, browse to E:\Setupfiles, click ContosoDW.bdcm, and then click Open.

5. Point out the message stating that the BDC Model Designer only supports editing models with a
single .NET LobSystem. Explain that the ContosoDW.bdcm file models a SQL Server connection.

6. In the BDC Method Details pane, click BDC Explorer.

7. In the BDC Explorer pane, expand the ContosoDW node.

8. Right-click the uppermost ContosoDW node, and then click Properties.

9. In the Properties pane, in the drop-down list box at the top of the pane, point out that the name
includes the text Model. This indicates that the node represents the top-level Model element of the
BDC model.

10. In the BDC Explorer pane, click the second ContosoDW element.

11. In the Properties pane, in the drop-down list box at the top of the pane, point out that the name
includes the text LobSystem. This indicates that the node represents the LobSystem element of the
BDC model.

12. In the BDC Explorer pane, expand the second ContosoDW element, and then expand the
LobSystemInstances element.

13. Point out that the model includes a single LobSystemInstance element named ContosoDW. Explain
that this defines properties for a specific instance of an external system, such as connection strings
and authentication settings.

14. Expand the Employees node. Explain that Employees is an ECT.

15. Point out that the ECT contains two methods: a ReadItem method and a ReadList method.
16. On the ContosoDW.bdcm tab, click XML Editor.

17. In the Microsoft Visual Studio dialog box, click Yes.

18. Briefly review the XML content of the ContosoDW.bdcm file. Relate the elements in the XML file to
the structure you explored in the BDC Explorer pane.

19. Close Visual Studio.


9-4 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 2
Creating BDC Models in SharePoint Designer
Contents:
Resources 5
Demonstration: Creating and Consuming an External Content Type 5
Working with Business Connectivity Services 9-5

Resources
Configuring External System Authentication

Additional Reading: Before you consider enabling RevertToSelf authentication in a


production environment, review the guidance at Business Connectivity Services security operations
(SharePoint Server 2010) at http://go.microsoft.com/fwlink/?LinkId=328965. The article was
written for SharePoint 2010, but the concepts apply equally to SharePoint 2013.

Demonstration: Creating and Consuming an External Content Type


Demonstration Steps
1. On the Start screen, type SQL, and then click SQL Server Management Studio.

2. In the Connect to Server dialog box, click Connect.

3. In Object Explorer, expand Security, expand Logins, and then double-click


CONTOSO\Administrator.
Explain that you are going to use the Administrator account to access the external database, so you
first need to grant the account the required permissions in SQL Server.

4. In the Login Properties - CONTOSO\Administrator dialog box, under Select a page, click User
Mapping.

5. Under Users mapped to this login, in the Map column, select the ContosoRetailDW check box.

6. Under Database role membership for: ContosoRetailDW, select the db_datareader check box,
and then click OK.

7. Close SQL Server Management Studio.

8. On the Start screen, type SharePoint, and then click SharePoint 2013 Central Administration.

9. Under Application Management, click Manage service applications.

10. On the list of service applications, click Contoso Secure Store Service Application.

Explain that you are now going to create a secure store target application that you will use to
connect to the external database.

11. On the ribbon, in the Manage Target Applications group, click New.

12. On the Create New Secure Store Target Application page, in the Target Application ID box, type
ContosoDWApp.

13. In the Display Name box, type Contoso Retail Data Warehouse.

14. In the Contact E-mail box, type [email protected].


15. In the Target Application Type list, click Group, and then click Next.

16. Leave the Field Name, and Field Type unchanged, and then click Next.

17. In the Target Application Administrators box, type CONTOSO\Administrator.

18. In the Members box, type Everyone, and then click OK.

Explain that you have created a group target application that maps all users to a single set of
credentials. You will now set the credentials that the target application will use to connect to the
external database.
9-6 Developing Microsoft SharePoint Server 2013 Advanced Solutions

19. In the list of target applications, select the ContosoDWApp check box.

20. On the ribbon, in the Credentials group, click Set.

21. In the Set Credentials for Secure Store Target Application (Group) dialog box, in the Windows
User Name box, type CONTOSO\Administrator.

22. In the Windows Password, and Confirm Windows Password boxes, type Pa$$w0rd, and then click
OK.

23. Close Internet Explorer.

24. On the Start screen, type SharePoint, and the then click SharePoint Designer 2013.
25. In SharePoint Designer, click Open Site.

26. In the Open Site dialog box, in the Site name box, type http://sharepoint.contoso.com, and then
click Open.
27. If the Windows Security dialog box appears, log in as CONTOSO\Administrator with password
Pa$$w0rd.

Note: SharePoint Designer may take some time to open the site.

28. When SharePoint Designer has finished loading the site, in the Navigation pane, click External
Content Types.
29. On the ribbon, in the New group, click External Content Type.

30. In the External Content Type Information pane, in the Name row, click New external content
type.

31. Type Account, and then press Tab.

32. In the External System row, click Click here to discover external data sources.

33. Click Add Connection.


34. In the External Data Source Type Selection dialog box, in the Data Source Type list, click SQL
Server, and then click OK.

35. In the SQL Server Connection dialog box, in the Database Server box, type LONDON.

36. In the Database Name box, type ContosoRetailDW.

37. Click Connect with Impersonated Windows Identity.

38. In the Secure Store Application ID box, type ContosoDWApp, and then click OK.
39. In the BCS Secure Store : ContosoDWApp dialog box, log in as CONTOSO\Administrator with
password Pa$$w0rd, and then click OK.

40. On the Data Source Explorer tab, expand ContosoRetailDW, and then expand Tables.

41. If a Microsoft SharePoint Designer dialog box appears, displaying the error message Cannot
complete refresh, explain that this because BCS does not support some of the columns in the
database, and then click OK.
42. Right-click DimAccount, and then click Create All Operations.

43. In the All operations dialog box, on the Operation Properties page, click Next.
Working with Business Connectivity Services 9-7

44. On the Parameters Configuration page, in the Data Source Elements list, clear the
ParentAccountKey, AccountLabel, Operator, CustomMembers, ValueType,
CustomMemberOptions, ETLLoadID, LoadDate, and UpdateDate check boxes.

45. Click AccountKey, and confirm that Map to Identifier is selected.

46. Click AccountName, and then select the Show In Picker check box.

47. Click AccountType, select the Show In Picker check box, and then click Next.

48. On the Filter Parameters Configuration page, click Finish.

Explain that having created an external content type, you will now create an external list to display
data from the external content type.

49. On the ribbon, in the Lists & Forms group, click Create Lists & Form.

50. In the Save Confirmation dialog box, click Yes.

51. In the Create List and Form for Account dialog box, in the List Name box, type Accounts, and then
click OK.

52. On the ribbon, in the Views group, click Summary View.

Point out that the External Lists pane now includes a list named Accounts.

53. Close SharePoint Designer.

Explain that the final high-level step is to grant users permission to use the external content type you
have created.

54. On the Start screen, type SharePoint, and then click SharePoint 2013 Central Administration.

55. Under Application Management, click Manage service applications.

56. In the list of service applications, on the Business Data Connectivity Service Application row, click
the Contoto Business Data Connectivity Service Application link.

57. On the ribbon, in the Permissions group, click Set Metadata Store Permissions.
58. In the Set Metadata Store Permissions, type Administrator, and then click Add.

59. Under Permissions for CONTOSO\administrator, select all of the check boxes.

60. Select the Propagate permissions to all BDC Models, External Systems and External Content
Types in the BDC Metadata Store check box, and then click OK.

61. In the list of external content types, select the Account check box.

62. On the ribbon, in the Permissions group, click Set Object Permissions.

63. In the Set Object Permissions dialog box, type Everyone, and then click Add.

64. Under Permissions for Everyone, select the Execute and Selectable In Clients check boxes, and
then click OK.

65. In the Address bar, type http://sharepoint.contoso.com, and then press Enter.

66. On the Contoso SharePoint Site page, on the Quick Launch menu, click Accounts.

67. Verify that the Accounts list retrieves and displays a set of data from the external database.

68. Close all open windows.


9-8 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 3
Creating BDC Models in Visual Studio 2012
Contents:
Resources 9
Working with Business Connectivity Services 9-9

Resources
Creating App-Scoped BDC Models

Additional Reading: For more information on how to convert an app-scoped BDC model
to farm-scoped model, see How to: Convert an app-scoped external content type to tenant-scoped
at http://go.microsoft.com/fwlink/?LinkId=321942.
Additional Reading: For more information on authentication modes, see Available
Authentication Modes at http://go.microsoft.com/fwlink/?LinkId=321943.
9-10 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lab Review Questions and Answers


Lab: Working with Business Connectivity Services
Question and Answers
Lab Review
Question: You need to create an external content type to expose data from a SQL Server database. The
content type must be used in multiple Web Applications within your SharePoint farm. What type of
external content type would you create? What tool would you use to create the ECT with the least
amount of coding effort?

Answer: You need to create a farm-scoped external content type by using SharePoint Designer.

Question: You need to create an external content type to expose data from a custom data source. The
custom data source uses a binary file format documented by the developers who created it. What tools
would you use to create the ECT?

Answer: Visual Studio and the BDC Designer.


Question: You need to create an external content type to expose data from an OData service created by
another developer. What type of ECT would you create?

Answer: An app-scoped ECT.


Creating Advanced Business Data Connectivity Models 10-1

Module 10
Creating Advanced Business Data Connectivity Models
Contents:
Lesson 1: Configuring BDC Models for Search 2 

Lesson 3: Working with External Events and Notifications 4 

Module Review and Takeaways 7 


Lab Review Questions and Answers 9 
10-2 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 1
Configuring BDC Models for Search
Contents:
Demonstration: Exploring BDC Models for Search 3
Creating Advanced Business Data Connectivity Models 10-3

Demonstration: Exploring BDC Models for Search


Demonstration Steps
1. Start the 20489B-LON-SP-10 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Windows Start page, click Computer.

4. In File Explorer, browse to E:\Democode\NorthwindModel, and then double-click


NorthwindModel.sln.
5. In the How do you want to open this type of file (.sln)? dialog box, click Visual Studio 2012.

6. In Solution Explorer, expand NorthwindModel, and then double-click NorthwindModel.bdcm.


Review the various methods defined in the file.
7. In Solution Explorer, double-click ProductService.cs, review the various methods defined in the file,
and be sure to point out how the method names and parameters match.

8. Point out the ProductIDEnumerator, GetProductSecurity, and GetProductFile methods, walk


through the matching .NET code, and explain how the methods work.
10-4 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 3
Working with External Events and Notifications
Contents:
Demonstration: Working with External Events 5
Creating Advanced Business Data Connectivity Models 10-5

Demonstration: Working with External Events


Demonstration Steps
1. Explain that you have already deployed an OData service, and a corresponding external content type.

2. Open a new browser tab. In the address bar, type http://team.contoso.com, and then press Enter.

3. On the Contoso Team Site page, click Site Contents.

4. On the Site Contents page, click add an app.

5. On the Your Apps page, click External List.

6. In the Adding External List dialog box, in the Name box, type Customer.

7. In the External Content Type box, click Select External Content Type.

8. In the External Content Type Picker dialog box, click Northwind, and then click OK.
9. In the Adding External List dialog box, click Create.

10. On the Site Contents page, click the Customer link. It should display data from the OData feed,
which is in turn coming from the database.
11. Switch to Visual Studio.

12. In Solution Explorer, expand Northwind.svc, and then double-click Northwind.svc.cs.

13. Right-click the first line of the Subscribe method, point to Breakpoint, and then click Insert
Breakpoint.

14. On the Windows Start page, type SQL, and then click SQL Server Management Studio.

15. In the Connect to Server dialog box, click Connect.

16. In Object Explorer, expand Databases, expand Northwind, and then expand Tables.

17. Right-click dbo.EntitySubscribe, click Select Top 1000 Rows. Notice that there are no rows in the
table.
18. On the Windows Start page, type SharePoint, right-click SharePoint 2013 Management Shell, and
then click Run as administrator.

19. At the command prompt, type E:\Democode\SetupeventReceiver.ps1, and then press Enter.
Monitor Visual Studio for the breakpoint to be hit. Highlight the method variables to show that the
values were sent from SharePoint.

20. In Visual Studio, press F5 to continue.


21. Switch back to SQL Server Management Studio, click Execute to refresh the table rows, you should
now see one row. Point out the DeliveryURL address to the students.

22. Switch back to Visual Studio, in the NotificationTesting project, double-click Program.cs. Notice
how it simply gets the latest delivery address and then sends an http post to that address. Point out
that the message that is sent is an Atom Feed.

23. On the DEBUG menu, click Attach to Process.

24. In the Attach to Process dialog box, select the Show processes from all users check box.

25. Select all the w3wp.exe processes, and then click Attach.

26. In the Attach Security Warning dialog box, click Attach.

27. In the Attach Security Warning dialog box, click Attach.


10-6 Developing Microsoft SharePoint Server 2013 Advanced Solutions

28. In the Attach Security Warning dialog box, click Attach.

29. In the Attach Security Warning dialog box, click Attach.

30. On the DEBUG menu, click Attach to Process.

31. In the Attach to Process dialog box, click the OWSTIMER.exe process, and then click Attach.

32. In the Attach Security Warning dialog box, click Attach.

33. In Solution Explorer, under ExternalListEventReceiver, double-click BCSEventReceiver.cs.

34. Right-click the following line of code, point to Breakpoint, and then click Insert Breakpoint:

base.ItemAdded(properties);

35. In Solution Explorer, right-click NotificationTesting, point to Debug, and then click Start new
instance. When the break point gets hit in your event receiver, SharePoint has successfully received
the message.

36. Press F5 to continue.

37. Switch to SharePoint Central Administration.

38. Click Central Administration.

39. Under Application Management, click Manage service applications.

40. Click Business Data Connectivity Service.

41. On the ribbon, in the View section, in the list, click BDC Models.

42. Select the NorthwindModel check box.

43. On the ribbon, click Delete.

44. In the Message from webpage dialog box, click OK.

45. Close Internet Explorer.


46. In Visual studio, on the DEBUG menu, click Stop Debugging.

47. Close Visual Studio.

48. Close SQL Server Management Studio.


49. Close SharePoint 2013 Management Shell.
Creating Advanced Business Data Connectivity Models 10-7

Module Review and Takeaways


Review Question(s)
Question: Which stereotyped method is used to get a single item’s metadata?

( ) IdEnumerator

( ) EventSubscriber

( ) Finder

( ) SpecificFinder

( ) StreamAccessor

Answer:

( ) IdEnumerator

( ) EventSubscriber

( ) Finder
(√) SpecificFinder

( ) StreamAccessor

Question: Which of the following is not a type of search connector model?


( ) .NET Connector

( ) Custom Connector

( ) WCF Connector
( ) COM Connector

( ) Database Connector

Answer:
( ) .NET Connector

( ) Custom Connector

( ) WCF Connector
(√) COM Connector

( ) Database Connector

Question: True or False: ShowInSearchUI is the only property that you need to specify in a connector
model in order to use the model in search dialogs.

( ) True

( ) False
Answer:

( ) True

(√) False
10-8 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Question: True or False: Subscriptions are supported automatically by OData feeds.

( ) True

( ) False

Answer:

( ) True

(√) False
Creating Advanced Business Data Connectivity Models 10-9

Lab Review Questions and Answers


Lab: Creating and Deploying a .NET Connectivity Assembly
Question and Answers
Lab Review
Question: What is the most important thing to double check when building your entity model methods
and your entity class methods?

Answer: Method names and parameters.

Question: What is the reason for having multiple methods that retrieve information about single items
such as metadata, security, and file contents?

Answer: Performance.
Working with Business Data 11-1

Module 11
Working with Business Data
Contents:
Lesson 1: Working with Business Data in Composite Solutions 2 

Lesson 3: Working with Business Data in Client Applications 7 

Lab Review Questions and Answers 10 


11-2 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 1
Working with Business Data in Composite Solutions
Contents:
Demonstration: Using Actions and External Data Columns 3
Demonstration: Using Business Data in Workflows 4
Working with Business Data 11-3

Demonstration: Using Actions and External Data Columns


Demonstration Steps
1. Start the 20489A-LON-SP-11 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Windows Start page, click Computer.

4. In File Explorer, browse to E:\Democode\NorthwindService.

5. Right-click NorthwindService.sln, point to Open with, and then click Microsoft Visual Studio
2012.

6. Press F5 to start the service. Explain that you have started an example OData service that provides
data from a back-end database.
7. On the Windows Start page, type Central Administration, and then press Enter.

8. On the Central Administration home page, under Application Management, click Manage service
applications.

9. On the list of service applications, click on the first instance of Business Data Connectivity Service.

10. In the list of external content types, on the Customers drop-down menu, click Add Action.

11. On the Add Action page, in the Action Name box, type Search Company.
12. In the Navigate To This URL box, type
http://team.contoso.com/_layouts/osssearchresults.aspx?k={0}.

Note: At this point, mention that you can use any URL, not just internal URLs, in ECT
actions. However, in a classroom environment the virtual machine is not connected to an external
network.

13. Under Launch the action in a new Web browser window (applies to External Data Web Parts
only), click Yes.

14. Under URL Parameters, click Add Parameter.


15. Under Parameter Property, in the list, click CompanyName.

16. Select the Default action check box, and then click OK.

17. In the Address bar, type http://team.contoso.com, and then press Enter.

18. On the Settings menu, click Add an app.

19. On the Your Apps page, click External List.

20. In the Adding External List dialog box, in the Name box, type Customers.

21. Under External Content Type, click the Select External Content Type icon.

22. In the External Content Type Picker dialog box, click Customers, and then click OK.

23. In the Adding External List dialog box, click Create.

24. On the Site Contents page, click Customers.

25. Verify that the Customers page displays several rows of data.

26. In any row, click the ellipsis, and then click Search Company.
11-4 Developing Microsoft SharePoint Server 2013 Advanced Solutions

27. Verify that Internet Explorer opens a new tab that displays a page named Search, where the search
text is the company name of the item you selected.

Note: The Search page will not display any results because the search service is not
configured on this virtual machine.

28. Close the Internet Explorer tab that contains the Search page.

29. On the Settings menu, click Add an app.

30. On the Your Apps page, click Custom List.

31. In the Adding Custom List dialog box, type CustomerExt, and then click Create.

32. On the Site Contents page, click CustomerExt.

33. On the ribbon, on the LIST tab, click Create Column.

34. In the Create Column dialog box, in the Column name box, type CustomerID.

35. Under The type of information in this column is, click External Data.

36. Under External Content Type, click the Select External Content Type icon.

37. In the External Content Type Picker dialog box, click Customers, and then click OK.

38. In the Create Column dialog box, under Select the Field to be shown on this column, in the drop-
down list, click CustomerID.

39. Under Add a column to show each of these additional fields, select the CompanyName, and
ContactName check boxes, and then click OK.

40. Click new item.

41. In the Title box, type Alfreds.

42. In the CustomerID box, click the Select External Item(s) icon.

43. In the Choose Customers dialog box, click ALFKI, and then click OK.

44. Click Save.


45. Verify that the external list displays data in the CustomerID, CustomerID: CompanyName, and
CustomerID: ContactName columns.

46. Switch to Visual Studio.


47. On the DEBUG menu, click Stop Debugging.

48. Close all open windows.

Demonstration: Using Business Data in Workflows


Demonstration Steps
1. On the Windows Start page, click Computer.

2. In File Explorer, browse to E:\Democode\NorthwindService.

3. Right-click NorthwindService.sln, point to Open with, and then click Microsoft Visual Studio
2012.
4. Press F5 to start the service. Explain that you have started an example OData service that provides
data from a backend database.
Working with Business Data 11-5

5. In Internet Explorer, click New Tab.

6. In the Address bar, type http://team.contoso.com, and then press Enter.

7. On the Quick Launch navigation menu, click Customers.

Explain that you will look up information from this list as part of a site workflow.

8. Point out that the first row of the list contains a CustomerID value of ALFKI, and that this
corresponds to a CompanyName value of Alfreds Futterkiste.

9. Close the current Internet Explorer tab only.

10. On the Start screen, type SharePoint Designer, and then press Enter.

11. In SharePoint Designer, click Open Site.

12. In the Open Site dialog box, in the Site name box, type http://team.contoso.com, and then click
Open.

13. If the Windows Security dialog box appears, in the User name box, type Administrator, in the
Password box, type Pa$$w0rd, and then click OK.

14. On the ribbon, click List Workflow. Point out that the Customers external list is not listed because
you cannot create list workflows for external lists.

15. On the ribbon, click Site Workflow.

16. In the Create Site Workflow dialog box, in the Name box, type External List Workflow, and then
click OK.

Note: At this point, point out that you are using SharePoint 2010 workflow mode for simplicity,
because using SharePoint 2013 workflow requires additional configuration that would place additional
load on the virtual machine. In a SharePoint 2013 workflow, you would use the Call Web Service activity
to interact with the external list through the REST API.

17. On the ribbon, in the Insert group, on the Action drop-down menu, click Set Workflow Variable.
18. Click workflow variable, and then click Create a new variable.

19. In the Edit Variable dialog box, in the Name box, type CompanyName.

20. In the Type list, click String, and then click OK.

21. Click value, and then click fx.

22. In the Lookup for String dialog box, in the Data source list, click Customers.

23. In the Field from source list, click CompanyName.

24. In the Field list, click CustomerID.

25. In the Value box, type ALFKI, and then click OK.

26. In the Microsoft SharePoint Designer dialog box, click Yes.

27. In the Step 1 box, click below the statement you just created.

28. On the ribbon, on the Action drop-down menu, click Log to History List.

29. Click this message, and then click fx.


30. In the Lookup for String dialog box, in the Data source list, click Workflow Variables and
Parameters.

31. In the Field from source list, click Variable: CompanyName, and then click OK.

32. On the ribbon, click Workflow Settings.


11-6 Developing Microsoft SharePoint Server 2013 Advanced Solutions

33. Under Start Options, ensure Allow this workflow to be manually started is selected.

34. On the ribbon, click Publish.

35. In Internet Explorer, click New Tab.

36. In the Address bar, type http://team.contoso.com, and then press Enter.

37. On the Quick Launch navigation menu, click Site Contents.

38. On the Site Contents page, click SITE WORKFLOWS.

39. On the Workflows: Contoso Team Site page, click External List Workflow.

40. On the Start “External List Workflow” page, click Start.


41. When the workflow has finished running, under My Completed Workflows, click External List
Workflow.

42. Point out that the Description column contains the value Alfreds Futterkiste. This is the company
name that corresponds to the customer ID you provided.

43. Switch to Visual Studio.

44. On the DEBUG menu, click Stop Debugging.


Working with Business Data 11-7

Lesson 3
Working with Business Data in Client Applications
Contents:
Demonstration: BCS and Office Clients 8
11-8 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Demonstration: BCS and Office Clients


Demonstration Steps
1. Start the 20489A-LON-SP-11 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Windows Start page, type SharePoint Designer, and then press Enter.

4. In SharePoint Designer, click Open Site.

5. In the Open Site dialog box, in the Site name box, type http://team.contoso.com, and then click
Open.

6. If you are prompted for credentials, log in as CONTOSO\Administrator with password Pa$$w0rd.

7. In the Navigation pane, click External Content Types.

8. On the ribbon, in the New group, click External Content Type.

9. In the External Content Type Information section, next to Name, click New external content
type.

10. Type Customer Contacts, and then press Tab.

11. In the Office Item Type list, click Contact.

12. In the External Content Type Operations section, click Click here to discover external data
sources and define operations.

13. Click Add Connection.

14. In the External Data Source Type Selection dialog box, in the Data Source Type list, click SQL
Server, and then click OK.

15. In the SQL Server Connection dialog box, in the Database Server box, type London.

16. In the Database Name box, type ContosoRetailDW.


17. Click Connect with Impersonated Windows Identity.

18. In the Secure Store Application ID box, type ContosoDW, and then click OK.

19. In the BCS Secure Store : ContosoDW dialog box, in the User name box, type
CONTOSO\Administrator.

20. In the Password box, type Pa$$w0rd, and then click OK.

21. On the Data Source Explorer tab, expand ContosoRetailDW, and then expand Tables.

22. In the Microsoft SharePoint Designer dialog box, explain that the unsupported types will not affect
the demonstration, and then click OK.

23. Under Tables, right-click DimCustomer, and then click Create All Operations.

24. In the All operations dialog box, on the Operation Properties page, click Next.

25. On the Parameters Configuration page, under Data Source Elements, click FirstName (the text,
not the check box).

26. In the Properties pane, in the Office Property list, click First Name (FirstName).

27. Under Data Source Elements, click LastName (the text, not the check box).

28. In the Properties pane, in the Office Property list, click Last Name (LastName), and then click
Next.
Working with Business Data 11-9

29. On the Filter Parameters Configuration page, click Add Filter Parameter.

30. In the Properties pane, next to Filter, click (Click to Add).

31. In the Filter Configuration dialog box, in the Filter Type list, click Limit, and then click OK.

32. In the Properties pane, in the Default Value box, type 25, and then click Finish.

33. On the FILE menu, click Save.

34. On the ribbon, click Create Lists & Form.

35. In the Create List and Form for Customer Contacts dialog box, in the List name box, type
Customer Contacts, and then click OK.

36. Close SharePoint Designer.

37. On the Start screen, type Central Administration, and then press Enter.

38. Under Application Management, click Manage service applications.


39. On the list of service applications, click on the first instance of Business Data Connectivity Service.

40. On the list of external content types, on the Customer Contacts drop-down menu, click Set
Permissions.

41. In the Set Object Permissions dialog box, type Everyone, and then click Add.

42. Under Permissions for Everyone, select the Execute, and Selectable In Clients check boxes, and
then click OK.

43. In the Address bar, type http://team.contoso.com, and then press Enter.

44. If you are prompted for credentials, log on as CONTOSO\Administrator with password Pa$$w0rd.

45. On the Settings menu, click Site settings.

46. Under Site Actions, click Manage site features.

47. On the Site Features page, in the Offline Synchronization for External Lists row, click Activate.

48. On the Quick Launch navigation menu, click Customer Contacts.

49. On the ribbon, on the LIST tab, click Connect to Outlook.

50. In the Microsoft Office Customization Installer dialog box, click Install.

51. When the Microsoft Office Customization Installer dialog box reports that the customization was
successfully installed, click Close.

52. When the BCS has finished generating the installation package, Outlook will open automatically.
Point out the list of customer contacts.

53. Close all open windows.


11-10 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lab Review Questions and Answers


Lab: Working with Business Data in Apps for SharePoint
Question and Answers
Lab Review
Question: You need to access an external content type hosted in a SharePoint site from a client
Windows-based application. What object model should you use?

Answer: .NET client-side object model.

Question: You need to access an external content type hosted in a SharePoint site from a SharePoint
sandboxed solution. What object model should you use?

Answer: Server-side object model.


Question: You need to access an external list hosted in a SharePoint site from a SharePoint app. What
object model should you use?

Answer: Client-side object model, JavaScript Object model or REST API.

Question: True or False: You can associate workflows with external lists.

( ) True

( ) False

Answer:

( ) True

(√) False
Question: What is the name of the process that manages the Business Connectivity Service Client Cache?

( ) W3wp.exe

( ) Mssearch.exe

( ) BCSSync.exe

( ) Noderunner.exe

Answer:

( ) W3wp.exe

( ) Mssearch.exe

(√) BCSSync.exe

( ) Noderunner.exe

Question: True or False: You can deploy an ECT via the Client Side Object Model (CSOM)

( ) True

( ) False

Answer:

( ) True

(√) False
Managing and Accessing User Profile Data 12-1

Module 12
Managing and Accessing User Profile Data
Contents:
Lesson 1: User Profile Data in SharePoint 2013 2 

Lesson 2: Options for Accessing User Profile Data 4 

Lesson 3: Managing User Profile Data 6 


Lesson 4: Managing User Profile Properties 8 

Module Review and Takeaways 10 


12-2 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 1
User Profile Data in SharePoint 2013
Contents:
Resources 3
Demonstration: Reviewing the Default User Profile Properties 3
Managing and Accessing User Profile Data 12-3

Resources
Profile Properties and Data Protection

Additional Reading: You can set the default privacy setting for a user profile property by
using code. For more information on setting privacy settings on user profile properties, see How
to: Set Privacy Policies for User Profile Properties at
http://go.microsoft.com/fwlink/?LinkId=321955

Demonstration: Reviewing the Default User Profile Properties


Demonstration Steps
1. Start the 20489B-LON-SP-12 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Start screen, type SharePoint, and then click SharePoint 2013 Central Administration.

4. In Internet Explorer, under Application Management, and then click Manage service applications.
5. On the Manage Service Applications page, click Contoso User Profiles.

6. On the Contoso User Profiles page, under People, click Manage User Properties.

7. On the Manage User Properties page, point to First name, click the drop-down arrow, and then
click Edit.

8. On the Edit User Profile Property page, point out the data type, profile subtypes, and default
privacy settings.

9. Click the Back to Manage User Properties button.

10. Click the Back to Manage Profile Service: Contoso User Profiles button.

11. On the Contoso User Profiles page, under Synchronization, click Configure Synchronization
Settings.

12. On the Configure Synchronization Settings page, point out that that the service application is
configured for basic Active Directory import, but that you can choose to use full SharePoint Profile
Synchronization, or use an external identity manager.

13. Close Internet Explorer.


12-4 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 2
Options for Accessing User Profile Data
Contents:
Resources 5
Managing and Accessing User Profile Data 12-5

Resources
Searching for Users

Additional Reading: For more information on how to configure people search, see Deploy
people search in SharePoint Server 2013 at http://go.microsoft.com/fwlink/?LinkId=321954
12-6 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 3
Managing User Profile Data
Contents:
Resources 7
Demonstration: Retrieving User Profile Properties in Server-side Code 7
Managing and Accessing User Profile Data 12-7

Resources
Updating User Profile Properties

Additional Reading: For more information on working with user profiles in SharePoint
2013, see Work with user profiles in SharePoint 2013 at
http://go.microsoft.com/fwlink/?LinkId=321953

Demonstration: Retrieving User Profile Properties in Server-side Code


Demonstration Steps
1. Start the 20489B-LON-SP-12 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Start screen, type Visual Studio, and then click Visual Studio 2012.
4. In Visual Studio, on the FILE menu, point to Open, and then click Project/Solution.

5. In the Open Project dialog box, browse to E:\Democode\ManageUserProfileProperties, click


ManageUserProfileProperties.sln, and then click Open.
6. In Solution Explorer, expand ManageUserProfileProperties, and then double-click Program.cs.

7. Point out the code that obtains a reference to the user profile service application, and the code
enumerates the properties of the default profile subtype.

8. In Solution Explorer, right-click ManageUserProfileProperties, point to Debug, and then click Start
new instance.

9. When Visual Studio displays a UserProfileApplicationNotAvailableException, explain that this is


because the Administrator user (current user) does not have permission to connect to the user profile
service application.

10. On the DEBUG menu, click Stop Debugging.

11. In Solution Explorer, expand Loader, and then under Loader, double-click Program.cs.

12. Review the code. Explain that to connect to the user profile service application, the account requires
specific permissions. Explain that the Administrator account does not have these permissions, but
the SPFarm account does. This code grants the SPFarm account the necessary permissions to run an
interactive application (by adding the account to the Domain Admins security group) before starting
the ManageUserProfileProperties application in the context of the SPFarm account. This enables
the application to connect to the user profile service application. Finally, the code removes the
SPFarm account from the Domain Admins security group.

13. In Solution Explorer, right-click Loader, and then click Set as StartUp Project.

14. On the DEBUG menu, click Start Debugging. In the console window, point out the list of profile
properties.

15. Close all open windows.


12-8 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 4
Managing User Profile Properties
Contents:
Resources 9
Managing and Accessing User Profile Data 12-9

Resources
Deleting User Profile Properties

Additional Reading: For more information on working with user profiles in server-side
code, see How to: Work with user profiles and organization profiles by using the server object
model in SharePoint 2013 at http://go.microsoft.com/fwlink/?LinkId=321952
12-10 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Module Review and Takeaways


Review Question(s)
Question: True or False: User profile properties from a line-of-business application exposed by using the
User Profile Service Application do not increase the risk of exposing confidential information.

( ) True

( ) False

Answer:

( ) True

(√) False

Question: True or False: All site users have a user profile.

( ) True

( ) False
Answer:

( ) True

(√) False

Question: Which of the following statements is true?

( ) You can update all user profile properties by using either server-side or client-side code.

( ) You can update all user profile properties by using server-side code only.
( ) You can update all user profile properties by using client-side code only.

( ) You can update all user profile properties by using server-side code, and the user profile picture by
using client-side code.

( ) You can update all user profile properties by using client-side code, and the user profile picture by
using server-side code.

Answer:

( ) You can update all user profile properties by using either server-side or client-side code.

( ) You can update all user profile properties by using server-side code only.

( ) You can update all user profile properties by using client-side code only.

(√) You can update all user profile properties by using server-side code, and the user profile
picture by using client-side code.

( ) You can update all user profile properties by using client-side code, and the user profile
picture by using server-side code.
Managing and Accessing User Profile Data 12-11

Question: True or False: You can create more than one subtype property based on a single type property.

( ) True

( ) False

Answer:

(√) True

( ) False
Customizing the Social Workload 13-1

Module 13
Customizing the Social Workload
Contents:
Lesson 1: Overview of the Social Workload 2 

Lesson 2: Developing Social Solutions 4 

Lesson 3: Working with Feeds 6 


Module Review and Takeaways 9 
13-2 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 1
Overview of the Social Workload
Contents:
Demonstration: Using My Sites in SharePoint 2013 3
Customizing the Social Workload 13-3

Demonstration: Using My Sites in SharePoint 2013


Demonstration Steps
1. Start the 20489B-LON-SP-13 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Start screen, click Internet Explorer.

4. In Internet Explorer, in the address bar, type http://my.contoso.com, and then press Enter.

5. If SharePoint displays the We’re still collecting the latest news. You may see more if you try
again a little later message, periodically refresh the page. This may take many minutes. Explain that
SharePoint uses timer jobs to populate the newsfeed and that as a result of the virtual machine being
shut down for extended periods, these timer jobs must execute before the feed is populated. This is
unlikely to happen in a production environment.

6. Point out the Newsfeed page including the Following, Everyone, and Mentions feeds.

7. On the Quick Launch menu, click About me.


8. Point out the feed of activities.

9. On the Quick Launch menu, click Blog.

10. Point out the blog entries and blog tools.

11. In Internet Explorer, click Back to Administrator.

12. On the Quick Launch menu, click Apps.

13. Point out the list of apps, and the option to add an app.

14. On the Quick Launch menu, click Tasks.

15. Point out the list of tasks.

16. On the SharePoint menu bar, click SkyDrive.


17. Point out the list of documents, and on the Quick Launch menu, point out the Followed Documents
link.

18. On the SharePoint menu bar, click Sites.


19. Point out the list of sites currently being followed.

20. Close Internet Explorer.


13-4 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 2
Developing Social Solutions
Contents:
Resources 5
Demonstration: Tagging and Following Entities by Using Out-of-the-Box Functionality 5
Customizing the Social Workload 13-5

Resources
Actors

Additional Reading: For more information about the properties available in the
SocialActor class, see the SocialActor members page at
http:/go.microsoft.com/fwlink/?LinkId=321957

Demonstration: Tagging and Following Entities by Using Out-of-the-Box


Functionality
Demonstration Steps
1. Start the 20489B-LON-SP-13 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Start screen, click Internet Explorer.

4. In Internet Explorer, in the address bar, type http://project.contoso.com, and then press Enter.
5. On the Quick Launch menu, click Newsfeed.

6. On the Newsfeed page, in the Start a conversation text box, type This is a #newtag, and then click
Post.

7. In the new post, click #newtag.

8. On the About #newtag page, click follow.

9. On the Quick Launch menu, click Newsfeed.


10. In the I’m following list, above tags, click the number 1.

11. Review the Followed #Tags list.

12. Close Internet Explorer.


13-6 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 3
Working with Feeds
Contents:
Resources 7
Demonstration: Retrieving a Newsfeed by Using the JavaScript Object Model 7
Customizing the Social Workload 13-7

Resources
Retrieving Feeds

Additional Reading: For more information about the SocialFeedManager class, see the
SocialFeedManager members MSDN page at http://go.microsoft.com/fwlink/?LinkId=321960

Adding Mentions and Tags to a Feed Post

Additional Reading: For more information about the SocialDataItem class, see the
SocialDataItem members MSDN page at http://go.microsoft.com/fwlink/?LinkId=321965

Demonstration: Retrieving a Newsfeed by Using the JavaScript Object


Model
Demonstration Steps
1. Start the 20489B-LON-SP-13 virtual machine.

2. Log on to the LONDON machine as CONTOSO\Administrator with password Pa$$w0rd.

3. On the Start screen type Visual Studio, and then click Visual Studio 2012.
4. In Visual Studio, on the FILE menu, point to Open, and then click Project/Solution.

5. In the Open Project dialog box, browse to E:\Democode\NewsfeedApp, click NewsfeedApp.sln,


and then click Open.
6. In Solution Explorer, expand NewsfeedApp, expand Pages, and then double-click Default.aspx.

7. Review the contents of the Default.aspx page. Point out the additional JavaScript file reference for
the sp.userprofiles.js script file, and the empty posts div.

8. In Solution Explorer, expand Scripts, and then double-click App.js.

9. Review the contents of the App.js file. The getNewsFeed and getNewsFeedSuccess functions, load
the newsfeed for the current user and add the root post of each of the newsfeed threads to the page.
10. Point out the code that invokes the getNewsFeed function when the page loads, and then
subsequently every five seconds.

11. In Solution Explorer, double-click AppManifest.xml.

12. In the App Manifest designer, on the Permissions tab, point out that this app requires the User
Profiles (Social) and Tenant permissions to enable it to access the user’s newsfeed.

13. On the DEBUG menu, click Start Debugging.

14. In Internet Explorer, click Trust It.

15. In a new instance of Internet Explorer, browse to http://my.contoso.com. Arrange the two instances
of Internet Explorer so that they can be seen side by side.

16. On the Newsfeed page, in the Start a conversation box, type A new post and then click Post.

17. Point out that the post appears in the newsfeed on the My Site newsfeed, and that the post also
appears in the app (the Newsfeed Posts page).

18. On the Newsfeed page, under A new post, click Reply.


13-8 Developing Microsoft SharePoint Server 2013 Advanced Solutions

19. In the Reply text box, type A reply, and then under the Reply text box, click Post.

20. Point out that although the reply is displayed on the My Site, it is not displayed in the app. Explain
that this is because the app is only displaying the root post for each thread.

21. Close all open windows.


Customizing the Social Workload 13-9

Module Review and Takeaways


Review Question(s)
Question: Which of the following service applications is not commonly required when developing a social
app?

( ) Managed Metadata Service

( ) User Profile Service Application

( ) Managed Metadata Service

( ) Search Service Application

( ) Word Automation Services

Answer:

( ) Managed Metadata Service

( ) User Profile Service Application


( ) Managed Metadata Service

( ) Search Service Application

(√) Word Automation Services

Question: Which of the following is not a type of actor?

( ) Site

( ) Document
( ) Post

( ) User

( ) Tag
Answer:

( ) Site

( ) Document

(√) Post

( ) User

( ) Tag

Question: A user can add a root post on a different user’s My Site feed.

( ) True

( ) False
Answer:

( ) True

(√) False
Monitoring and Troubleshooting Custom SharePoint Solutions 14-1

Module 14
Monitoring and Troubleshooting Custom SharePoint
Solutions
Contents:
Lesson 1: Debugging SharePoint Apps in Visual Studio 2 

Lesson 2: Diagnosing Faults in Deployed Apps 4 


Module Review and Takeaways 6 

Lab Review Questions and Answers 7 


14-2 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 1
Debugging SharePoint Apps in Visual Studio
Contents:
Resources 3
Demonstration: Debugging JavaScript in Visual Studio and Internet Explorer 3
Monitoring and Troubleshooting Custom SharePoint Solutions 14-3

Resources
Configuring a SharePoint Site for Debugging

Best Practice: You should enable debugging only in development, testing, and staging
sites. Never enable debugging in production sites, because debugging information can help
malicious users to find out about your configuration and software. This may enable those users to
mount an effective attack against your site.

Debugging JavaScript Code

Best Practice: Make sure all developers realize that they should switch to minimized
versions of all the JavaScript libraries just before the project is deployed. In addition, you should
bundle custom JavaScript into larger libraries to improve performance.

Demonstration: Debugging JavaScript in Visual Studio and Internet


Explorer
Demonstration Steps
1. In Solution Explorer, expand the Scripts folder, and then double-click App.js.

2. Locate the following line of code:

taxonomySession = SP.Taxonomy.TaxonomySession.getTaxonomySession(context);

3. On the DEBUG menu, click Start Debugging.


4. In Solution Explorer, highlight the contents of the Script Documents folder.

5. Click sp.runtime.debug.js to show the code.

6. Click SP.Taxonomy.js to show the code.


7. Click App.js.

8. On the DEBUG menu, click Step Into. Visual Studio steps into code in the SP.Taxonomy.js file.

9. On the DEBUG menu, click Step Into. Visual Studio steps into code in the SP.Taxonomy.js file.
10. On the DEBUG menu, click Stop Debugging.

11. In Internet Explorer, click the Tools icon, and then click F12 developer tools.

12. In Internet Explorer, in the address bar, click the Refresh icon.

13. In the Profiler list, click the first entry.

14. Type loadTermStore. The developer tools highlight the line for the loadTermStore function.

15. Close the F12 developer tools.

16. Close Internet Explorer.

17. Close Visual Studio.


14-4 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Lesson 2
Diagnosing Faults in Deployed Apps
Contents:
Resources 5
Monitoring and Troubleshooting Custom SharePoint Solutions 14-5

Resources
IIS Tracing

Best Practice: Make sure to provide the user with a second button or other method to
disable tracing when diagnostic information has been recorded.
14-6 Developing Microsoft SharePoint Server 2013 Advanced Solutions

Module Review and Takeaways


Best Practice
Use debugging JavaScript libraries when you want to browse and step through the code in those libraries.
For production environments, switch to minimized JavaScript libraries to ensure that the app downloads
to the browser as fast as possible.

Best Practice
If you use ASP.NET Tracing or MiniProfiler to investigate a problem in a deployed app, make sure you
disable those tools as soon as you have the information you require. These tools are likely to impact
performance because of the extra work they must do to record app behavior

Review Question(s)
Question: You want make recommendations for the server hardware necessary to run a SharePoint
remote-hosted app. You expect several thousand concurrent users at peak times. Should you use profiling
or stress testing to determine appropriate hardware?
Answer: You should use stress testing to determine this information.

Question: True or False: The ELMAH NuGet package can profile the behavior of JavaScript in SharePoint
Apps.

( ) True

( ) False

Answer:
( ) True

(√) False

Common Issues and Troubleshooting Tips


Common Issue Troubleshooting Tip

When you try to start an app in debugging This error appears if you deploy an app to a
mode, you receive the error "Sideloading host web that does not have the Developer
of apps is not enabled on this site". feature enabled. You can enable this hidden
feature in PowerShell or you can debug the
app against a host web that is created from
the Developer site collection template.
Monitoring and Troubleshooting Custom SharePoint Solutions 14-7

Lab Review Questions and Answers


Lab: Enabling ASP.NET Tracing
Question and Answers
Lab Review
Question: In Exercise 2, Task 1, you added a new <trace> element to the web.config file with the
enabled attribute set to false. Why is it necessary to create this element, when code in the ToggleTracing
action sets the enabled attribute to true?

Answer: The <trace> element you added configures default tracing properties, such as the
request limit and the trace mode.

Question: What are the consequences of leaving tracing enabled after you have diagnosed a bug?

Answer: The app continues to function smoothly if you leave tracing enabled longer than
necessary, but performance is reduced.

You might also like