0% found this document useful (0 votes)
260 views158 pages

20488B ENU Companion

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 158

O F F I C I A L

M I C R O S O F T

20488B

L E A R N I N G

P R O D U C T

Developing Microsoft SharePoint Server


2013 Core 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: 20488B


Released: 10/2013

MICROSOFT LICENSE TERMS


MICROSOFT INSTRUCTOR-LED COURSEWARE
These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its
affiliates) and you. Please read them. They apply to your use of the content accompanying this agreement which
includes the media on which you received it, if any. These license terms also apply to Trainer Content and any
updates and supplements for the Licensed Content unless other terms accompany those items. If so, those terms
apply.
BY ACCESSING, DOWNLOADING OR USING THE LICENSED CONTENT, YOU ACCEPT THESE TERMS.
IF YOU DO NOT ACCEPT THEM, DO NOT ACCESS, DOWNLOAD OR USE THE LICENSED CONTENT.
If you comply with these license terms, you have the rights below for each license you acquire.
1.

DEFINITIONS.
a. Authorized Learning Center means a Microsoft IT Academy Program Member, Microsoft Learning
Competency Member, or such other entity as Microsoft may designate from time to time.
b. Authorized Training Session means the instructor-led training class using Microsoft Instructor-Led
Courseware conducted by a Trainer at or through an Authorized Learning Center.
c.

Classroom Device means one (1) dedicated, secure computer that an Authorized Learning Center owns
or controls that is located at an Authorized Learning Centers training facilities that meets or exceeds the
hardware level specified for the particular Microsoft Instructor-Led Courseware.

d. End User means an individual who is (i) duly enrolled in and attending an Authorized Training Session
or Private Training Session, (ii) an employee of a MPN Member, or (iii) a Microsoft full-time employee.
e. Licensed Content means the content accompanying this agreement which may include the Microsoft
Instructor-Led Courseware or Trainer Content.
f.

Microsoft Certified Trainer or MCT means an individual who is (i) engaged to teach a training session
to End Users on behalf of an Authorized Learning Center or MPN Member, and (ii) currently certified as a
Microsoft Certified Trainer under the Microsoft Certification Program.

g. Microsoft Instructor-Led Courseware means the Microsoft-branded instructor-led training course that
educates IT professionals and developers on Microsoft technologies. A Microsoft Instructor-Led
Courseware title may be branded as MOC, Microsoft Dynamics or Microsoft Business Group courseware.
h. Microsoft IT Academy Program Member means an active member of the Microsoft IT Academy
Program.
i.

Microsoft Learning Competency Member means an active member of the Microsoft Partner Network
program in good standing that currently holds the Learning Competency status.

j.

MOC means the Official Microsoft Learning Product instructor-led courseware known as Microsoft
Official Course that educates IT professionals and developers on Microsoft technologies.

k.

MPN Member means an active silver or gold-level Microsoft Partner Network program member in good
standing.

l.

Personal Device means one (1) personal computer, device, workstation or other digital electronic device
that you personally own or control that meets or exceeds the hardware level specified for the particular
Microsoft Instructor-Led Courseware.

m. Private Training Session means the instructor-led training classes provided by MPN Members for
corporate customers to teach a predefined learning objective using Microsoft Instructor-Led Courseware.
These classes are not advertised or promoted to the general public and class attendance is restricted to
individuals employed by or contracted by the corporate customer.
n. Trainer means (i) an academically accredited educator engaged by a Microsoft IT Academy Program
Member to teach an Authorized Training Session, and/or (ii) a MCT.
o. Trainer Content means the trainer version of the Microsoft Instructor-Led Courseware and additional
supplemental content designated solely for Trainers use to teach a training session using the Microsoft
Instructor-Led Courseware. Trainer Content may include Microsoft PowerPoint presentations, trainer
preparation guide, train the trainer materials, Microsoft One Note packs, classroom setup guide and Prerelease course feedback form. To clarify, Trainer Content does not include any software, virtual hard
disks or virtual machines.
2.

USE RIGHTS. The Licensed Content is licensed not sold. The Licensed Content is licensed on a one copy
per user basis, such that you must acquire a license for each individual that accesses or uses the Licensed
Content.

2.1

Below are five separate sets of use rights. Only one set of rights apply to you.
a. If you are a Microsoft IT Academy Program Member:
i. Each license acquired on behalf of yourself may only be used to review one (1) copy of the Microsoft
Instructor-Led Courseware in the form provided to you. If the Microsoft Instructor-Led Courseware is
in digital format, you may install one (1) copy on up to three (3) Personal Devices. You may not
install the Microsoft Instructor-Led Courseware on a device you do not own or control.
ii. For each license you acquire on behalf of an End User or Trainer, you may either:
1. distribute one (1) hard copy version of the Microsoft Instructor-Led Courseware to one (1) End
User who is enrolled in the Authorized Training Session, and only immediately prior to the
commencement of the Authorized Training Session that is the subject matter of the Microsoft
Instructor-Led Courseware being provided, or
2. provide one (1) End User with the unique redemption code and instructions on how they can
access one (1) digital version of the Microsoft Instructor-Led Courseware, or
3. provide one (1) Trainer with the unique redemption code and instructions on how they can
access one (1) Trainer Content,
provided you comply with the following:
iii. you will only provide access to the Licensed Content to those individuals who have acquired a valid
license to the Licensed Content,
iv. you will ensure each End User attending an Authorized Training Session has their own valid licensed
copy of the Microsoft Instructor-Led Courseware that is the subject of the Authorized Training
Session,
v. you will ensure that each End User provided with the hard-copy version of the Microsoft InstructorLed Courseware will be presented with a copy of this agreement and each End User will agree that
their use of the Microsoft Instructor-Led Courseware will be subject to the terms in this agreement
prior to providing them with the Microsoft Instructor-Led Courseware. Each individual will be required
to denote their acceptance of this agreement in a manner that is enforceable under local law prior to
their accessing the Microsoft Instructor-Led Courseware,
vi. you will ensure that each Trainer teaching an Authorized Training Session has their own valid
licensed copy of the Trainer Content that is the subject of the Authorized Training Session,

vii. you will only use qualified Trainers who have in-depth knowledge of and experience with the
Microsoft technology that is the subject of the Microsoft Instructor-Led Courseware being taught for
all your Authorized Training Sessions,
viii. you will only deliver a maximum of 15 hours of training per week for each Authorized Training
Session that uses a MOC title, and
ix. you acknowledge that Trainers that are not MCTs will not have access to all of the trainer resources
for the Microsoft Instructor-Led Courseware.
b. If you are a Microsoft Learning Competency Member:
i. Each license acquired on behalf of yourself may only be used to review one (1) copy of the Microsoft
Instructor-Led Courseware in the form provided to you. If the Microsoft Instructor-Led Courseware is
in digital format, you may install one (1) copy on up to three (3) Personal Devices. You may not
install the Microsoft Instructor-Led Courseware on a device you do not own or control.
ii. For each license you acquire on behalf of an End User or Trainer, you may either:
1. distribute one (1) hard copy version of the Microsoft Instructor-Led Courseware to one (1) End
User attending the Authorized Training Session and only immediately prior to the
commencement of the Authorized Training Session that is the subject matter of the Microsoft
Instructor-Led Courseware provided, or
2. provide one (1) End User attending the Authorized Training Session with the unique redemption
code and instructions on how they can access one (1) digital version of the Microsoft InstructorLed Courseware, or
3. you will provide one (1) Trainer with the unique redemption code and instructions on how they
can access one (1) Trainer Content,
provided you comply with the following:
iii. you will only provide access to the Licensed Content to those individuals who have acquired a valid
license to the Licensed Content,
iv. you will ensure that each End User attending an Authorized Training Session has their own valid
licensed copy of the Microsoft Instructor-Led Courseware that is the subject of the Authorized
Training Session,
v. you will ensure that each End User provided with a hard-copy version of the Microsoft Instructor-Led
Courseware will be presented with a copy of this agreement and each End User will agree that their
use of the Microsoft Instructor-Led Courseware will be subject to the terms in this agreement prior to
providing them with the Microsoft Instructor-Led Courseware. Each individual will be required to
denote their acceptance of this agreement in a manner that is enforceable under local law prior to
their accessing the Microsoft Instructor-Led Courseware,
vi. you will ensure that each Trainer teaching an Authorized Training Session has their own valid
licensed copy of the Trainer Content that is the subject of the Authorized Training Session,
vii. you will only use qualified Trainers who hold the applicable Microsoft Certification credential that is
the subject of the Microsoft Instructor-Led Courseware being taught for your Authorized Training
Sessions,
viii. you will only use qualified MCTs who also hold the applicable Microsoft Certification credential that is
the subject of the MOC title being taught for all your Authorized Training Sessions using MOC,
ix. you will only provide access to the Microsoft Instructor-Led Courseware to End Users, and
x. you will only provide access to the Trainer Content to Trainers.

c.

If you are a MPN Member:


i. Each license acquired on behalf of yourself may only be used to review one (1) copy of the Microsoft
Instructor-Led Courseware in the form provided to you. If the Microsoft Instructor-Led Courseware is
in digital format, you may install one (1) copy on up to three (3) Personal Devices. You may not
install the Microsoft Instructor-Led Courseware on a device you do not own or control.
ii. For each license you acquire on behalf of an End User or Trainer, you may either:
1. distribute one (1) hard copy version of the Microsoft Instructor-Led Courseware to one (1) End
User attending the Private Training Session, and only immediately prior to the commencement
of the Private Training Session that is the subject matter of the Microsoft Instructor-Led
Courseware being provided, or
2. provide one (1) End User who is attending the Private Training Session with the unique
redemption code and instructions on how they can access one (1) digital version of the
Microsoft Instructor-Led Courseware, or
3. you will provide one (1) Trainer who is teaching the Private Training Session with the unique
redemption code and instructions on how they can access one (1) Trainer Content,
provided you comply with the following:
iii. you will only provide access to the Licensed Content to those individuals who have acquired a valid
license to the Licensed Content,
iv. you will ensure that each End User attending an Private Training Session has their own valid licensed
copy of the Microsoft Instructor-Led Courseware that is the subject of the Private Training Session,
v. you will ensure that each End User provided with a hard copy version of the Microsoft Instructor-Led
Courseware will be presented with a copy of this agreement and each End User will agree that their
use of the Microsoft Instructor-Led Courseware will be subject to the terms in this agreement prior to
providing them with the Microsoft Instructor-Led Courseware. Each individual will be required to
denote their acceptance of this agreement in a manner that is enforceable under local law prior to
their accessing the Microsoft Instructor-Led Courseware,
vi. you will ensure that each Trainer teaching an Private Training Session has their own valid licensed
copy of the Trainer Content that is the subject of the Private Training Session,
vii. you will only use qualified Trainers who hold the applicable Microsoft Certification credential that is
the subject of the Microsoft Instructor-Led Courseware being taught for all your Private Training
Sessions,
viii. you will only use qualified MCTs who hold the applicable Microsoft Certification credential that is the
subject of the MOC title being taught for all your Private Training Sessions using MOC,
ix. you will only provide access to the Microsoft Instructor-Led Courseware to End Users, and
x. you will only provide access to the Trainer Content to Trainers.

d. If you are an End User:


For each license you acquire, you may use the Microsoft Instructor-Led Courseware solely for your
personal training use. If the Microsoft Instructor-Led Courseware is in digital format, you may access the
Microsoft Instructor-Led Courseware online using the unique redemption code provided to you by the
training provider and install and use one (1) copy of the Microsoft Instructor-Led Courseware on up to
three (3) Personal Devices. You may also print one (1) copy of the Microsoft Instructor-Led Courseware.
You may not install the Microsoft Instructor-Led Courseware on a device you do not own or control.
e. If you are a Trainer.
i.
For each license you acquire, you may install and use one (1) copy of the Trainer Content in the
form provided to you on one (1) Personal Device solely to prepare and deliver an Authorized
Training Session or Private Training Session, and install one (1) additional copy on another Personal
Device as a backup copy, which may be used only to reinstall the Trainer Content. You may not
install or use a copy of the Trainer Content on a device you do not own or control. You may also
print one (1) copy of the Trainer Content solely to prepare for and deliver an Authorized Training
Session or Private Training Session.

ii.

You may customize the written portions of the Trainer Content that are logically associated with
instruction of a training session in accordance with the most recent version of the MCT agreement.
If you elect to exercise the foregoing rights, you agree to comply with the following: (i)
customizations may only be used for teaching Authorized Training Sessions and Private Training
Sessions, and (ii) all customizations will comply with this agreement. For clarity, any use of
customize refers only to changing the order of slides and content, and/or not using all the slides or
content, it does not mean changing or modifying any slide or content.

2.2 Separation of Components. The Licensed Content is licensed as a single unit and you may not
separate their components and install them on different devices.
2.3 Redistribution of Licensed Content. Except as expressly provided in the use rights above, you may
not distribute any Licensed Content or any portion thereof (including any permitted modifications) to any
third parties without the express written permission of Microsoft.
2.4 Third Party Programs and Services. The Licensed Content may contain third party programs or
services. These license terms will apply to your use of those third party programs or services, unless other
terms accompany those programs and services.
2.5 Additional Terms. Some Licensed Content may contain components with additional terms,
conditions, and licenses regarding its use. Any non-conflicting terms in those conditions and licenses also
apply to your use of that respective component and supplements the terms described in this agreement.
3.

LICENSED CONTENT BASED ON PRE-RELEASE TECHNOLOGY. If the Licensed Contents subject


matter is based on a pre-release version of Microsoft technology (Pre-release), then in addition to the
other provisions in this agreement, these terms also apply:
a. Pre-Release Licensed Content. This Licensed Content subject matter is on the Pre-release version of
the Microsoft technology. The technology may not work the way a final version of the technology will
and we may change the technology for the final version. We also may not release a final version.
Licensed Content based on the final version of the technology may not contain the same information as
the Licensed Content based on the Pre-release version. Microsoft is under no obligation to provide you
with any further content, including any Licensed Content based on the final version of the technology.
b. Feedback. If you agree to give feedback about the Licensed Content to Microsoft, either directly or
through its third party designee, you give to Microsoft without charge, the right to use, share and
commercialize your feedback in any way and for any purpose. You also give to third parties, without
charge, any patent rights needed for their products, technologies and services to use or interface with
any specific parts of a Microsoft software, Microsoft product, or service that includes the feedback. You
will not give feedback that is subject to a license that requires Microsoft to license its software,
technologies, or products to third parties because we include your feedback in them. These rights
survive this agreement.
c.

Pre-release Term. If you are an Microsoft IT Academy Program Member, Microsoft Learning
Competency Member, MPN Member or Trainer, you will cease using all copies of the Licensed Content on
the Pre-release technology upon (i) the date which Microsoft informs you is the end date for using the
Licensed Content on the Pre-release technology, or (ii) sixty (60) days after the commercial release of the
technology that is the subject of the Licensed Content, whichever is earliest (Pre-release term).
Upon expiration or termination of the Pre-release term, you will irretrievably delete and destroy all copies
of the Licensed Content in your possession or under your control.

4.

SCOPE OF LICENSE. The Licensed Content is licensed, not sold. This agreement only gives you some
rights to use the Licensed Content. Microsoft reserves all other rights. Unless applicable law gives you more
rights despite this limitation, you may use the Licensed Content only as expressly permitted in this
agreement. In doing so, you must comply with any technical limitations in the Licensed Content that only
allows you to use it in certain ways. Except as expressly permitted in this agreement, you may not:

access or allow any individual to access the Licensed Content if they have not acquired a valid license
for the Licensed Content,

alter, remove or obscure any copyright or other protective notices (including watermarks), branding
or identifications contained in the Licensed Content,

modify or create a derivative work of any Licensed Content,

publicly display, or make the Licensed Content available for others to access or use,

copy, print, install, sell, publish, transmit, lend, adapt, reuse, link to or post, make available or
distribute the Licensed Content to any third party,

work around any technical limitations in the Licensed Content, or

reverse engineer, decompile, remove or otherwise thwart any protections or disassemble the
Licensed Content except and only to the extent that applicable law expressly permits, despite this
limitation.

5. RESERVATION OF RIGHTS AND OWNERSHIP. Microsoft reserves all rights not expressly granted to
you in this agreement. The Licensed Content is protected by copyright and other intellectual property laws
and treaties. Microsoft or its suppliers own the title, copyright, and other intellectual property rights in the
Licensed Content.
6.

EXPORT RESTRICTIONS. The Licensed Content is subject to United States export laws and regulations.
You must comply with all domestic and international export laws and regulations that apply to the Licensed
Content. These laws include restrictions on destinations, end users and end use. For additional information,
see www.microsoft.com/exporting.

7.

SUPPORT SERVICES. Because the Licensed Content is as is, we may not provide support services for it.

8.

TERMINATION. Without prejudice to any other rights, Microsoft may terminate this agreement if you fail
to comply with the terms and conditions of this agreement. Upon termination of this agreement for any
reason, you will immediately stop all use of and delete and destroy all copies of the Licensed Content in
your possession or under your control.

9.

LINKS TO THIRD PARTY SITES. You may link to third party sites through the use of the Licensed
Content. The third party sites are not under the control of Microsoft, and Microsoft is not responsible for
the contents of any third party sites, any links contained in third party sites, or any changes or updates to
third party sites. Microsoft is not responsible for webcasting or any other form of transmission received
from any third party sites. Microsoft is providing these links to third party sites to you only as a
convenience, and the inclusion of any link does not imply an endorsement by Microsoft of the third party
site.

10.

ENTIRE AGREEMENT. This agreement, and any additional terms for the Trainer Content, updates and
supplements are the entire agreement for the Licensed Content, updates and supplements.

11.

APPLICABLE LAW.
a. United States. If you acquired the Licensed Content in the United States, Washington state law governs
the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws
principles. The laws of the state where you live govern all other claims, including claims under state
consumer protection laws, unfair competition laws, and in tort.

b. Outside the United States. If you acquired the Licensed Content in any other country, the laws of that
country apply.
12.

LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws
of your country. You may also have rights with respect to the party from whom you acquired the Licensed
Content. This agreement does not change your rights under the laws of your country if the laws of your
country do not permit it to do so.

13.

DISCLAIMER OF WARRANTY. THE LICENSED CONTENT IS LICENSED "AS-IS" AND "AS


AVAILABLE." YOU BEAR THE RISK OF USING IT. MICROSOFT AND ITS RESPECTIVE
AFFILIATES GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. YOU MAY
HAVE ADDITIONAL CONSUMER RIGHTS UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT
CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT AND
ITS RESPECTIVE AFFILIATES EXCLUDES ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.

14.

LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM
MICROSOFT, ITS RESPECTIVE AFFILIATES AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP
TO US$5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL,
LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
This limitation applies to
o
anything related to the Licensed Content, services, content (including code) on third party Internet
sites or third-party programs; and
o
claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence,
or other tort to the extent permitted by applicable law.
It also applies even if Microsoft knew or should have known about the possibility of the damages. The
above limitation or exclusion may not apply to you because your country may not allow the exclusion or
limitation of incidental, consequential or other damages.

Please note: As this Licensed Content is distributed in Quebec, Canada, some of the clauses in this
agreement are provided below in French.
Remarque : Ce le contenu sous licence tant distribu au Qubec, Canada, certaines des clauses
dans ce contrat sont fournies ci-dessous en franais.
EXONRATION DE GARANTIE. Le contenu sous licence vis par une licence est offert tel quel . Toute
utilisation de ce contenu sous licence est votre seule risque et pril. Microsoft naccorde aucune autre garantie
expresse. Vous pouvez bnficier de droits additionnels en vertu du droit local sur la protection dues
consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties
implicites de qualit marchande, dadquation un usage particulier et dabsence de contrefaon sont exclues.
LIMITATION DES DOMMAGES-INTRTS ET EXCLUSION DE RESPONSABILIT POUR LES
DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages
directs uniquement hauteur de 5,00 $ US. Vous ne pouvez prtendre aucune indemnisation pour les autres
dommages, y compris les dommages spciaux, indirects ou accessoires et pertes de bnfices.
Cette limitation concerne:
tout ce qui est reli au le contenu sous licence, aux services ou au contenu (y compris le code)
figurant sur des sites Internet tiers ou dans des programmes tiers; et.
les rclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilit
stricte, de ngligence ou dune autre faute dans la limite autorise par la loi en vigueur.

Elle sapplique galement, mme si Microsoft connaissait ou devrait connatre lventualit dun tel dommage. Si
votre pays nautorise pas lexclusion ou la limitation de responsabilit pour les dommages indirects, accessoires
ou de quelque nature que ce soit, il se peut que la limitation ou lexclusion ci-dessus ne sappliquera pas votre
gard.
EFFET JURIDIQUE. Le prsent contrat dcrit certains droits juridiques. Vous pourriez avoir dautres droits
prvus par les lois de votre pays. Le prsent contrat ne modifie pas les droits que vous confrent les lois de votre
pays si celles-ci ne le permettent pas.
Revised September 2012

SharePoint as a Developer Platform 1-1

Module 1
SharePoint as a Developer Platform
Contents:
Lesson 1: Introducing the SharePoint Developer Landscape

Lesson 3: Understanding SharePoint 2013 Deployment and Execution Models

Module Review and Takeaways

1-2 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 1

Introducing the SharePoint Developer Landscape


Contents:
Resources
Demonstration: Developer Tools for SharePoint 2013

3
3

SharePoint as a Developer Platform 1-3

Resources
What's New for Developers in SharePoint 2013
Additional Reading: For more information about new features in SharePoint 2013, see
What's new for developers in SharePoint 2013 at http://go.microsoft.com/fwlink/?LinkID=306774.

Entry Points for Developers in SharePoint 2013


Best Practice: In many scenarios, you will be able to choose whether to configure
SharePoint components declaratively (by creating CAML files) or imperatively (by writing code).
In most cases, you should use the declarative approach wherever possible. Declarative artifacts
are typically easier to read and easier to maintain.

Troubleshooting and Debugging SharePoint Solutions


Additional Reading: For more information about configuring diagnostic logging, see
Configure diagnostic logging in SharePoint 2013 at
http://go.microsoft.com/fwlink/?LinkID=320123.
Additional Reading: For more information about using the Visual Studio debugger for
SharePoint solutions, see Debugging SharePoint Solutions at
http://go.microsoft.com/fwlink/?LinkID=318027.

Demonstration: Developer Tools for SharePoint 2013


Demonstration Steps
1.

Start the 20488B-LON-SP-01 virtual machine.

2.

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

3.

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

4.

On the Start page, click New Project.

5.

In the New Project dialog box, in the left navigation pane, under Templates, expand Visual C#,
expand Office/SharePoint, and then click SharePoint Solutions.

6.

Point out that there are project templates for both SharePoint 2010 and SharePoint 2013. The
SharePoint 2013 templates are provided by Microsoft Office Developer Tools for Visual Studio 2012.

7.

In the left navigation pane, under Office/SharePoint, click Apps.

8.

In the center pane, click App for SharePoint 2013.

9.

In the Name box, type Demo1.

10. In the Location box, type E:\Demofiles, and then click OK.
11. In the New app for SharePoint dialog box, under What is the name of your app for SharePoint,
type Demo.
12. Under What SharePoint site do you want to use for debugging your app, type
http://dev.contoso.com.

1-4 Developing Microsoft SharePoint Server 2013 Core Solutions

13. Under How do you want to host your app for SharePoint, review the available options, click
SharePoint-hosted, and then click Finish.
14. Briefly review and discuss the contents of the project.
15. In Solution Explorer, right-click Demo1, point to Add, and then click New Item.
16. In the Add New Item - Demo1 dialog box, review the available project item templates, and then
click Cancel.
17. Close Visual Studio.
18. On the Start screen, type SharePoint Designer 2013, and then press Enter.
19. Click Open Site.
20. In the Open Site dialog box, in the Site name box, type http://team.contoso.com, and then click
Open.
21. If the Windows Security dialog box appears, log on as CONTOSO\Administrator with the password
Pa$$w0rd.
22. If the site does not open automatically, when the Open Site dialog box displays the contents of the
team.contoso.com site, click Open again.
23. On the ribbon, in the New group, briefly explore the different items you can add to the team site.
24. On the ribbon, in the Actions group, point out that you can perform core administration tasks, such
as resetting the site to its site definition and managing users and groups.
25. On the ribbon, in the Manage group, click the Preview in Browser drop-down menu (be sure to
click the drop-down menu, not the icon).
26. On the Preview in Browser menu, point out that you can preview the site at various resolutions and
in various browsers.
27. On the Preview in Browser menu, click Edit Browser List.
28. In the Edit Browser List dialog box, point out that you can add additional browsers to the preview
list, and then click Cancel.

SharePoint as a Developer Platform 1-5

Lesson 3

Understanding SharePoint 2013 Deployment and


Execution Models
Contents:
Resources

1-6 Developing Microsoft SharePoint Server 2013 Core Solutions

Resources
Farm Solutions
Best Practice: Deploying Features within solution packages offers many advantages over
manually installing Features. When you install a farm solution, any Features within the solution
are automatically copied to every WFE server in the SharePoint farm. When you uninstall the
solution, the Features are automatically removed from every WFE server in the farm.

SharePoint as a Developer Platform 1-7

Module Review and Takeaways


Review Question(s)
Question: Which of the following best describes unmodified content pages in SharePoint 2013?
( ) The page template and the page content are stored on the server-side file system.
( ) The page template and the page content are stored in the content database.
( ) The page template is stored on the server-side file system, and the page content is stored in the
content database.
( ) The page template is stored in the content database, and the page content is stored on the serverside file system.
( ) The page template is stored in the configuration database, and the page content is stored in the
content database.
Answer:
( ) The page template and the page content are stored on the server-side file system.
( ) The page template and the page content are stored in the content database.
() The page template is stored on the server-side file system, and the page content is stored in
the content database.
( ) The page template is stored in the content database, and the page content is stored on the
server-side file system.
( ) The page template is stored in the configuration database, and the page content is stored in
the content database.
Question: You need to automate a business process that collects information from several different users.
Which approach to development should you use?
( ) Create a Web Part.
( ) Create an application page.
( ) Create a timer job.
( ) Create an event receiver.
( ) Create a workflow.
Answer:
( ) Create a Web Part.
( ) Create an application page.
( ) Create a timer job.
( ) Create an event receiver.
() Create a workflow.

1-8 Developing Microsoft SharePoint Server 2013 Core Solutions

Question: You need to make a list template, together with custom site columns and content types,
available to users across Contoso. Which deployment model should you use?
( ) Create and install a feature. Manually activate the feature on site collections where the list template is
required.
( ) Create a feature within a sandboxed solution. Install the sandboxed solution on site collections where
the list template is required.
( ) Create a feature within a farm solution. Install the solution at the farm scope. Activate the feature on
site collections where the list template is required.
( ) Create a feature within a SharePoint app. Publish the app to your corporate catalog. Add the app onsite collections where the list template is required.
( ) Create and install a feature. Use feature stapling to associate the feature with the Project Site
template.
Answer:
( ) Create and install a feature. Manually activate the feature on site collections where the list
template is required.
( ) Create a feature within a sandboxed solution. Install the sandboxed solution on site
collections where the list template is required.
( ) Create a feature within a farm solution. Install the solution at the farm scope. Activate the
feature on site collections where the list template is required.
() Create a feature within a SharePoint app. Publish the app to your corporate catalog. Add the
app on-site collections where the list template is required.
( ) Create and install a feature. Use feature stapling to associate the feature with the Project Site
template.

Working with SharePoint Objects 2-1

Module 2
Working with SharePoint Objects
Contents:
Lesson 2: Working with Sites and Webs

Lesson 3: Working with Execution Contexts

Module Review and Takeaways

Lab Review Questions and Answers

2-2 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 2

Working with Sites and Webs


Contents:
Resources
Demonstration: Updating Properties

5
5

Working with SharePoint Objects 2-3

Resources
Managing Object Life Cycles
Additional Reading: Disposal patterns for SharePoint objects form a broad subject area,
and there are various nuances beyond those discussed in this module. For more information, see
Best Practices: Using Disposable Windows SharePoint Services Objects at
http://go.microsoft.com/fwlink/?LinkID=306778. Although this article was written for SharePoint
2007, the principles it describes apply equally to SharePoint 2010 and SharePoint 2013.

Demonstration: Updating Properties


Demonstration Steps
1.

Start the 20488B-LON-SP-02 virtual machine.

2.

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

3.

In a File Explorer window, browse to E:\Democode\UpdatingProperties, and then double-click


UpdatingProperties.sln.

4.

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

5.

In Visual Studio, in Solution Explorer, expand the UpdatingProperties project node, expand
UpdatingPropertiesWebPart, and then double-click UpdatingProperties.ascx.

6.

At the bottom of the center pane, click Design.

7.

Point out that the user control consists of a simple UI with a text box named txtTitle, a text box
named txtDescription, and a button named btnUpdate.

8.

On the design surface, double-click the Update button to generate the click event handler for the
button.

9.

In the btnUpdate_Click method, type the following code to retrieve the current SPWeb instance,
and then press Enter:
varweb=SPContext.Current.Web;

10. Type the following code to set the title of the web, and then press Enter:
web.Title=txtTitle.Text;

11. Type the following code to set the description of the web, and then press Enter:
web.Description=txtDescription.Text;

12. Type the following code to write the changes to the database, and then press Enter:
web.Update();

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


14. If you are prompted for credentials, log on as CONTOSO\Administrator with the password
Pa$$w0rd.
15. In Internet Explorer, after the page finishes loading, on the PAGE tab, click Edit.
16. On the INSERT tab, click Web Part.

2-4 Developing Microsoft SharePoint Server 2013 Core Solutions

17. In the Categories list, click Contoso Web Parts.


18. In the Parts list, click Property Updates, and then click Add.
19. On the PAGE tab, click Save.
20. In the Property Updates Web Part, in the Site title box, type a new site title.
21. In the Site description box, type a new site description, and then click Update.
22. Verify that the page reloads with the updated site title.
23. Close Internet Explorer, and then close Visual Studio 2012.

Working with SharePoint Objects 2-5

Lesson 3

Working with Execution Contexts


Contents:
Resources

2-6 Developing Microsoft SharePoint Server 2013 Core Solutions

Resources
Understanding the SharePoint Context
Best Practice: Remember that you should not dispose of an SPSite or SPWeb object that
you have retrieved from SPContext.Current.Site or SPContext.Current.Web respectively.

Working with SharePoint Objects 2-7

Module Review and Takeaways


Review Question(s)
Question: You want to verify programmatically whether the Managed Metadata Service is running on any
servers in the local SharePoint farm. Which of the following classes represents a service running on a
server?
( ) SPApplicationPool
( ) SPService
( ) SPServiceInstance
( ) SPServiceApplication
( ) SPServiceApplicationProxy
Answer:
( ) SPApplicationPool
( ) SPService
() SPServiceInstance
( ) SPServiceApplication
( ) SPServiceApplicationProxy
Question: Consider the following code example. Which SPWeb objects require disposal?
var site = new SPSite("http://sharepoint.contoso.com");
var web1 = site.OpenWeb();
var web2 = SPContext.Current.Web;
var web3 = SPContext.Current.Site.RootWeb;
var web4 = SPContext.Current.Site.OpenWeb();
var web5 = SPContext.Current.Site.AllWebs["finance"];
Answer: web1, web3, web4, and web5 all require disposal.
Question: You want to execute a block of code ifand only ifthe current user has permission to edit
list items and delete list items. Which code sample should you use?
( ) var web = SPContext.Current.Web;
if(web.DoesUserHavePermissions(SPBasePermissions.EditListItems))
{
if(web.DoesUserHavePermissions(SPBasePermissions.DeleteListItems))
{
// Add code here.
}
}
( ) var web = SPContext.Current.Web;
if(web.DoesUserHavePermissions(SPBasePermissions.EditListItems | SPBasePermissions.DeleteListItems))
{
// Add code here.
}

2-8 Developing Microsoft SharePoint Server 2013 Core Solutions

( ) var web = SPContext.Current.Web;


if(web.DoesUserHavePermissions(SPBasePermissions.EditListItems & SPBasePermissions.DeleteListItems))
{
// Add code here.
}
( ) var web = SPContext.Current.Web;
if(web.DoesUserHavePermissions(SPBasePermissions.EditListItems || SPBasePermissions.DeleteListItems))
{
// Add code here.
}
( ) var web = SPContext.Current.Web;
if(web.DoesUserHavePermissions(SPBasePermissions.EditListItems && SPBasePermissions.DeleteListItems))
{
// Add code here.
}
Answer:
( ) var web = SPContext.Current.Web;
if(web.DoesUserHavePermissions(SPBasePermissions.EditListItems))
{
if(web.DoesUserHavePermissions(SPBasePermissions.DeleteListItems))
{
// Add code here.
}
}
( ) var web = SPContext.Current.Web;
if(web.DoesUserHavePermissions(SPBasePermissions.EditListItems | SPBasePermissions.DeleteListItems))
{
// Add code here.
}
() var web = SPContext.Current.Web;
if(web.DoesUserHavePermissions(SPBasePermissions.EditListItems & SPBasePermissions.DeleteListItems))
{
// Add code here.
}
( ) var web = SPContext.Current.Web;
if(web.DoesUserHavePermissions(SPBasePermissions.EditListItems || SPBasePermissions.DeleteListItems))
{
// Add code here.
}
( ) var web = SPContext.Current.Web;
if(web.DoesUserHavePermissions(SPBasePermissions.EditListItems && SPBasePermissions.DeleteListItems))
{
// Add code here.
}

Working with SharePoint Objects 2-9

Lab Review Questions and Answers


Lab A: Working with Sites and Webs
Question and Answers
Lab Review
Question: Which approach would you recommend to the management team: the visual Web Part or the
Windows PowerShell script? Why?
Answer: Both approaches have some merit. Creating Windows PowerShell scripts is a great way
to automate repetitive tasks. Creating a Windows PowerShell script is far quicker than creating
and deploying a Web Part. However, the Web Part provides a more interactive and user friendly
experience. Only administrators can run Windows PowerShell scripts, but this is not an issue if
you are automating administrative tasks.
Question: What happens if a user with insufficient permissions loads the Web Part? How would you work
around any issues caused by insufficient permissions?
Answer: Without any exception handling, the Web Part will raise an error if it attempts to
perform a task that the current user does not have permission to perform. The error will pass to
the page that contains the Web Part, and the page will display an error message instead of
rendering properly.
There are various ways to manage the permissions issue:

You could run with elevated privileges. However, this is a bad idea because you are unlikely
to want every user to be able to change web titles.

You could programmatically check for permissions, and hide the update controls if the
current user does not have sufficient permissions.

You could use an SPSecurityTrimmedControl to hide the update controls if the current
user does not have sufficient permissions.

The next lesson describes these approaches in more detail.


Question: Enumerating sites and webs is computationally expensive. Why is this particularly problematic
in a Web Part?
Answer: Performing computationally expensive tasks is particularly problematic in a Web Part,
because your logic will run every time a user loads the page containing your Web Part. This is less
of a problem in a Windows PowerShell script, for two reasons:

Your code only runs when an administrator explicitly runs the script, rather than every time a
web page is requested.

The logic runs within the Windows PowerShell process, rather than within the same worker
process as the SharePoint site (in the case of farm solutions).

Alternative approaches, such as using navigation provider classes to retrieve lists of sites and
webs or using timer jobs to perform computationally expensive tasks, are described later in this
course.

Working with Lists and Libraries 3-1

Module 3
Working with Lists and Libraries
Contents:
Lesson 1: Using List and Library Objects

Lesson 2: Querying and Retrieving List Data

Lesson 3: Working with Large Lists

Module Review and Takeaways

11

3-2 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 1

Using List and Library Objects


Contents:
Demonstration: Creating List Items

Working with Lists and Libraries 3-3

Demonstration: Creating List Items


Demonstration Steps
1.

Start the 20488B-LON-SP-03 virtual machine.

2.

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

3.

In a File Explorer window, browse to E:\Democode\WorkingWithListItems, and then double-click


WorkingWithListItems.sln.

4.

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

5.

In Visual Studio, in Solution Explorer, expand the WorkingWithListItems project node, expand the
WorkingWithListItems project item node, and then double-click WorkingWithListItems.ascx.

6.

At the bottom of the center pane, click Design.

7.

Point out that the user control consists of a simple UI with a text box named txtTitle, a text box
named txtDescription, a radio button list named rblPriority, and a button named btnSubmit.

8.

Right-click the design surface, and then click View Code.

9.

In the OnPreRender method, locate the comment that reads Populate the rblPriority radio button
list.

10. Immediately below the comment, add the following code:


varweb=SPContext.Current.Web;
varlist=web.Lists["Complaints"];
varfield=list.Fields["Priority"]asSPFieldChoice;
rblPriority.DataSource=field.Choices;
rblPriority.DataBind();

Note: This code populates the radio button list with the available choices for the Priority
field.
11. In the btnSubmit_Click method, locate the comment that reads Add a new list item to the
complaints list.
12. Immediately below the comment, add the following code:
varweb=SPContext.Current.Web;
varlist=web.Lists["Complaints"];
varitem=list.Items.Add();
item["Title"]=txtTitle.Text;
item["Details"]=txtDescription.Text;
item["Priority"]=rblPriority.SelectedValue;
item.Update();

Note: This code creates a new list item in the Complaints list, and sets field values using
the values provided by the user.
13. On the BUILD menu, click Rebuild Solution.
14. On the DEBUG menu, click Start Without Debugging.

3-4 Developing Microsoft SharePoint Server 2013 Core Solutions

15. If you are prompted for credentials, log on as CONTOSO\Administrator with the password
Pa$$w0rd.
Note: If the error page appears, just refresh the page.
16. In Internet Explorer, after the page finishes loading, on the ribbon, click EDIT.
17. On the INSERT tab, click Web Part.
18. In the Categories list, click Contoso Web Parts.
19. In the Parts list, click Working With List Items, and then click Add.
20. On the PAGE tab, click Save.
21. On the Working With List Items Web Part, in the Title box, type a title for your complaint.
22. In the Description box, type some details for your complaint.
23. In the Priority list, select a priority, and then click Submit.
24. On the Quick Launch navigation menu, click Complaints.
25. Verify that your complaint was added to the list.
26. Close Internet Explorer and close Visual Studio.

Working with Lists and Libraries 3-5

Lesson 2

Querying and Retrieving List Data


Contents:
Resources
Demonstration: Generating Entity Classes in Visual Studio 2012

6
7

3-6 Developing Microsoft SharePoint Server 2013 Core Solutions

Resources
Building CAML Queries
Additional Reading: For more general information about working with CAML in
SharePoint 2013, see Introduction to Collaborative Application Markup Language (CAML) at
http://go.microsoft.com/fwlink/?LinkID=306782.

Using the SPQuery Class


Additional Reading: For more information about these properties, see SPQuery class at
http://go.microsoft.com/fwlink/?LinkID=306784.

Using LINQ to SharePoint


Additional Reading: For more information about entity classes, see Entity Classes at
http://go.microsoft.com/fwlink/?LinkID=306788.

Using SPMetal to Generate Entity Classes


Additional Reading: For detailed information about how to create a parameters file, see
Overriding SPMetal Defaults by Using a Parameters XML File at
http://go.microsoft.com/fwlink/?LinkID=311888.
Additional Reading: For more information about SPMetal, including command line
options and how to use a parameters file, see SPMetal at
http://go.microsoft.com/fwlink/?LinkID=306787.

Demonstration: Generating Entity Classes in Visual Studio 2012


Demonstration Steps
1.

Connect to the 20488B-LON-SP-03 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.

On the Start screen, type Computer, right-click Computer, and then click Properties.

4.

In the System window, click Advanced system settings.

5.

In the System Properties dialog box, click Environment Variables.

6.

In the Environment Variables dialog box, under System variables, select the Path row, and then
click Edit.

7.

In the Edit System Variable dialog box, in the Variable value box, press End, type the following, and
then click OK:
;C:\ProgramFiles\CommonFiles\MicrosoftShared\WebServerExtensions\15\BIN

Working with Lists and Libraries 3-7

Note: Take care not to edit or delete any of the existing values in the Path variable.
8.

In the Environment Variables dialog box, click OK.

9.

In the System Properties dialog box, click OK.

10. In a File Explorer window, browse to E:\Democode\UsingSPMetal, and then double-click


UsingSPMetal.sln.
11. If the How do you want to open this type of file (.sln) dialog box appears, click Visual Studio
2012.
12. In Solution Explorer, right-click the project node (the UsingSPMetal node immediately below the
Solution node), and then click Properties.
13. Click Build Events.
14. In the Pre-build event command line box, type the following:
cd$(ProjectDir)
SPMetal/web:http://team.contoso.com/code:TeamSite.cs

15. On the FILE menu, click Save All.


16. On the BUILD menu, click Rebuild Solution.
17. In Solution Explorer, right-click References, and then click Add Reference.
18. In the search box, type Microsoft.SharePoint.Linq.
19. In the center pane, select Microsoft.SharePoint.Linq (make sure the check box is selected), and then
click OK.
20. In Solution Explorer, right-click the project node, point to Add, and then click Existing Item.
21. In the Add Existing Item dialog box, click TeamSite.cs, and then click Add.
22. Briefly explore the TeamSite.cs file. Point out that the file contains a top-level class named
TeamSiteDataContext, together with classes for all the list content types in the site.
23. In Solution Explorer, expand UsingSPMetalWebPart, expand UsingSPMetalWebPart.ascx, and then
double-click UsingSPMetalWebPart.ascx.cs.
24. At the top of the page, immediately below the existing using statements, add the following using
statements:
usingMicrosoft.SharePoint.Linq;
usingSystem.Linq;

25. In the Page_Load method, type the following code to instantiate a DataContext object, and then
press Enter:
TeamSiteDataContextcontext=newTeamSiteDataContext("http://team.contoso.com");

26. Type the following code, and then press Enter:


varsalesDocs=fromdocincontext.Documents

27. Type the following code, and then press Enter:


wheredoc.Title.Contains("Sales")

3-8 Developing Microsoft SharePoint Server 2013 Core Solutions

28. Type the following code, and then press Enter:


selectdoc;

29. Note that the Visual Studio IDE is using LINQ to SharePoint to provide IntelliSense and strongly typed
objects in your code.
30. Save your changes and close all open windows.

Working with Lists and Libraries 3-9

Lesson 3

Working with Large Lists


Contents:
Resources

10

3-10 Developing Microsoft SharePoint Server 2013 Core Solutions

Resources
Overriding List View Thresholds
Additional Reading: Various nuances and limitations apply when you use an object
model override. For more information, see SPQueryThrottleOption enumeration at
http://go.microsoft.com/fwlink/?LinkID=306789.

Working with Lists and Libraries 3-11

Module Review and Takeaways


Review Question(s)
Question: Which class represents a column in a SharePoint list?
( ) SPField
( ) SPFieldValue
( ) SPListItem
( ) SPFile
( ) SPFolder
Answer:
() SPField
( ) SPFieldValue
( ) SPListItem
( ) SPFile
( ) SPFolder
Question: You have created and configured an SPQuery object named query. You have also retrieved an
SPList instance
named list. You want to use the query object to retrieve data from the list. Which code sample should you
use?
( ) var items = query.Execute(list);
( ) var items = list.GetSiteData(query);
( ) var items = query.GetItems(list);
( ) var items = list.GetItems(query);
( ) var items = list.ExecuteQuery(query);
Answer:
( ) var items = query.Execute(list);
( ) var items = list.GetSiteData(query);
( ) var items = query.GetItems(list);
() var items = list.GetItems(query);
( ) var items = list.ExecuteQuery(query);

3-12 Developing Microsoft SharePoint Server 2013 Core Solutions

Question: What is the default list view threshold for regular users?
( ) 200
( ) 500
( ) 2,000
( ) 5,000
( ) 20,000
Answer:
( ) 200
( ) 500
( ) 2,000
() 5,000
( ) 20,000

Designing and Managing Features and Solutions 4-1

Module 4
Designing and Managing Features and Solutions
Contents:
Lesson 1: Understanding Features and Solutions

Lesson 2: Configuring Features and Solutions

Lesson 3: Working with Sandboxed Solutions

10

Module Review and Takeaways

12

4-2 Developing Microsoft SharePoint 2013 Core Solutions

Lesson 1

Understanding Features and Solutions


Contents:
Resources
Demonstration: Exploring a Feature
Demonstration: Exploring a Solution

3
3
4

Designing and Managing Features and Solutions 4-3

Resources
Anatomy of a Feature
Additional Reading: For more information about the SharePoint Feature schemas, see
SharePoint Features schemas at http://go.microsoft.com/fwlink/?LinkID=306795.

Anatomy of a Solution
Additional Reading: For more information about solution manifest files, see Solution
schema at http://go.microsoft.com/fwlink/?LinkID=323477.

Demonstration: Exploring a Feature


Demonstration Steps
1.

Open a File Explorer window and browse to the C:\Program Files\Common Files\microsoft
shared\Web Server Extensions\15 folder.

2.

Explain that the 15 folder is the root of the SharePoint file system, commonly known as the
SharePoint root or the SharePoint hive.

3.

Within the 15 folder, browse to the TEMPLATE\FEATURES folder.

4.

Explain that the Features within this folder are one of the following:
a.

Built-in Features

b.

Features that were manually deployed

c.

Features that were deployed within a farm solution

5.

Browse to the ctypes folder. Explain that this is a built-in Feature that provisions a range of built-in
content types.

6.

Right-click feature.xml, point to Open with, and then click Microsoft Visual Studio 2012.

7.

Highlight the following key aspects of the feature.xml file:


a.

The feature is scoped to the Site (site collection) level.

b.

The feature is hidden from the user interface.

c.

The feature references three element manifest files, named ctypeswss.xml, ctypeswss2.xml, and
ctypeswss3.xml.

8.

Briefly mention the upgrade actions and versioning sections, and explain that students will learn more
about these capabilities in the next lesson.

9.

Switch back to File Explorer.

10. Double-click ctypeswss.xml.


11. Briefly review the contents of the file. Point out that the file defines several built-in content types,
such as Item, Document, Event, and Announcement.
12. Emphasize that one element manifest file can define multiple elements.
13. Close Visual Studio 2012.

4-4 Developing Microsoft SharePoint 2013 Core Solutions

14. In File Explorer, browse back to the FEATURES folder, and then browse to the BaseSite folder.
15. Point out that this Feature does not include any element manifest files.
16. Double-click feature.xml.
17. Point out that instead of specifying element manifest files, the Feature specifies a series of activation
dependencies. When this Feature is activated, the dependency Features are automatically activated.
Mention that Feature dependencies are covered in more detail in the next lesson.
18. Close Visual Studio 2012.
19. In File Explorer, browse back to the FEATURES folder, and then browse to the SiteAssets folder.
20. Point out that this Feature does not include any element manifest files.
21. Double-click feature.xml.
22. Point out that instead of specifying element manifest files or activation dependencies, this Feature
just registers a Feature receiver assembly that responds to Feature life cycle events. Mention that
Feature receivers are covered in more detail in the next lesson.
23. Close all open windows.

Demonstration: Exploring a Solution


Demonstration Steps
1.

Open a File Explorer window and browse to E:\Democode\ExpenseChecker.

2.

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

Note: This is the Expense Checker Web Part solution from the previous module. Students
should be familiar with the solution.
3.

On the BUILD menu, click Rebuild Solution.

4.

On the BUILD menu, click Publish.

5.

In the Publish dialog box, under Target Location, click the ellipsis button.

6.

In the Select Target Location dialog box, browse to the desktop, and then click Select Folder.

7.

In the Publish dialog box, click Publish.

8.

Close Visual Studio.

9.

On the desktop, right-click ExpenseChecker.wsp, and then click Rename.

10. Change the file name to ExpenseChecker.wsp.cab, and then press Enter.
11. In the Rename dialog box, click Yes.
12. Double-click ExpenseChecker.wsp.cab.
13. In the File Explorer window, copy all the files, paste them onto the desktop, and then close the File
Explorer window.
14. On the desktop, right-click manifest.xml, point to Open with, and then click Microsoft Visual
Studio 2012.
15. Explain that the manifest.xml file is the solution manifest file.

Designing and Managing Features and Solutions 4-5

16. Point out that the manifest includes an Assembly element. This deploys the Web Part assembly to
the global assembly cache.
17. Point out that the manifest includes a SafeControl element. This registers the Web Part as a safe
control in the Web.config file.
18. Point out that the manifest includes a FeatureManifest element. FeatureManifest elements identify
any Features that are included in the solution.
19. Close Visual Studio.
20. On the desktop, double-click elements.xml.
21. Explain that the elements.xml file is the element manifest file for the Feature that is included in the
solution.
22. Explain that the element manifest file uses a Module element to deploy the Web Part control
description file (ExpenseChecker.webpart) to the Web Parts gallery on the site collection when the
Feature is activated.
23. Close Visual Studio.
24. Delete all the files that you added to the desktop.

4-6 Developing Microsoft SharePoint 2013 Core Solutions

Lesson 2

Configuring Features and Solutions


Contents:
Resources
Demonstration: Using the Visual Studio Designer

7
7

Designing and Managing Features and Solutions 4-7

Resources
Planning and Configuring Feature Dependencies
Additional Reading: For more information about activation dependency rules, see
Activation Dependencies and Scope at http://go.microsoft.com/fwlink/?LinkID=323478. This
article was written for SharePoint 2010, but the concepts are equally applicable to SharePoint
2013.

Creating Feature Receivers


Best Practice: If you use the FeatureInstalled method to make changes when a Feature is
installed, you should also use the FeatureUninstalling method to reverse your changes if the
Feature is uninstalled. Similarly, if you use the FeatureActivated method to make changes when
a Feature is activated, you should use the FeatureDeactivating method to reverse the changes
when the Feature is deactivated.

Demonstration: Using the Visual Studio Designer


Demonstration Steps
1.

Open a File Explorer window and browse to E:\Democode\FeatureDependencies.

2.

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

3.

In Solution Explorer, briefly review the contents of the solution. Point out that the solution contains:
o

Site columns named ClientName, ContosoDepartment, InvoiceDueDate, InvoiceAmount, and


InvoiceStatus.

A content type named ContosoInvoice.

A list template named Invoices and an associated list instance named InvoicesInstance.

4.

Explain that the content type uses the site columns, and the list uses the content type.

5.

Point out that the solution does not currently contain any Features.

6.

In Solution Explorer, right-click Features, and then click Add Feature.

7.

In the Title box, type Invoicing Resources.

8.

In the Scope drop-down list, click Site.

9.

In the Items in the Solution list box, hold down Ctrl and click ClientName, ContosoDepartment,
ContosoInvoice, InvoiceDueDate, InvoiceAmount, and InvoiceStatus.

10. Click the single right arrow button, and then click Save.
11. Close the Feature1.feature tab.
12. In Solution Explorer, right-click Feature1, and then click Rename.
13. Type InvoicingResources, and then press Enter.
14. In Solution Explorer, right-click Features, and then click Add Feature.
15. In the Title box, type Invoices List.

4-8 Developing Microsoft SharePoint 2013 Core Solutions

16. In the Scope drop-down list, leave Web selected.


17. In the Items in the Solution list box, hold down Ctrl and click InvoicesInstance and Invoices.
18. Click the single right arrow button, and then click Save.
19. At the bottom of the page, expand Feature Activation Dependencies, and then click Add.
20. In the Add Feature Activation Dependencies dialog box, under Add a dependency on features in
the solution, click Invoicing Resources, and then click Add.
21. On the Manifest tab, point out that an ActivationDependency element has been added to the
Feature manifest file.
22. Click Save, and then close the Feature1.feature tab.
23. In Solution Explorer, right-click Feature1, and then click Rename.
24. Type InvoicesList, and then press Enter.
25. In Solution Explorer, expand Package, and then click Package.package.
26. Point out that the solution package includes both Features.
27. On the PROJECT menu, click FeatureDependencies Properties.
28. On the FeatureDependencies tab, in the list on the left of the page, click SharePoint.
29. On the Active Deployment Configuration drop-down list, click No Activation, and then click Save.
Note: The No Activation deployment configuration means that Visual Studio will deploy
the solution but will not attempt to automatically activate the Features.
30. On the BUILD menu, click Build Solution.
31. On the BUILD menu, click Deploy Solution.
32. On the Start screen, click Internet Explorer.
33. In the address bar, type team.contoso.com, and then press Enter.
34. If you are prompted for credentials, log on as CONTOSO\Administrator with the password
Pa$$w0rd.
35. After the page finishes loading, on the Settings menu, click Site settings.
36. On the Site Settings page, under Site Actions, click Manage site features.
37. On the Site Features page, in the Invoices List row, click Activate.
38. Point out the error message advising that the Invoicing Resources feature must be activated first.
39. On the Settings menu, click Site settings.
40. Under Site Collection Administration, click Site collection features.
41. In the Invoicing Resources row, click Activate.
42. On the site breadcrumb trail, click Site Settings.
43. Under Site Actions, click Manage site features.
44. On the Site Features page, in the Invoices List row, click Activate.
45. Point out that the Feature now activates successfully because you activated the dependency Feature.

Designing and Managing Features and Solutions 4-9

46. On the Quick Launch navigation menu, under Recent, click Invoices.
47. On the Invoices page, on the ribbon, on the ITEMS tab, point out that the Contoso Invoice content
type is available on the New Item drop-down menu.
48. Close all open windows.

4-10 Developing Microsoft SharePoint 2013 Core Solutions

Lesson 3

Working with Sandboxed Solutions


Contents:
Resources

10

Designing and Managing Features and Solutions 4-11

Resources
Understanding Sandboxed Solutions
Additional Reading: For comprehensive information about sandboxed solutions, see
Sandboxed Solutions at http://go.microsoft.com/fwlink/?LinkID=306982. This article was written
for SharePoint 2010, but the principles are equally applicable to SharePoint 2013.

Capabilities and Constraints


Reference Links: The patterns & practices team at Microsoft created a full-trust proxy to
enable sandboxed code to write to event logs and trace logs. For more information, see The
SharePoint Logger at http://msdn.microsoft.com/en-us/library/ff798395.aspx.
Additional Reading: For more information about full-trust proxies, see Hybrid
Approaches at http://go.microsoft.com/fwlink/?LinkID=323479.

4-12 Developing Microsoft SharePoint 2013 Core Solutions

Module Review and Takeaways


Review Question(s)
Question: You have created a Feature that provisions a content type. You want the content type to be
available on every site collection on the farm, if the site collection administrator wants to use it. What
value should you use for the Feature scope?
( ) Web
( ) Site
( ) WebApplication
( ) Farm
Answer:
( ) Web
() Site
( ) WebApplication
( ) Farm
Question: True or false: A Site-scoped Feature can include a dependency on a Web-scoped Feature.
( ) True
( ) False
Answer:
( ) True
() False
Question: Which of the following items cannot be deployed within a sandboxed solution?
( ) A Web Part.
( ) A custom list.
( ) A list item event receiver.
( ) A timer job.
( ) A site column.
Answer:
( ) A Web Part.
( ) A custom list.
( ) A list item event receiver.
() A timer job.
( ) A site column.

Working with Server-Side Code 5-1

Module 5
Working with Server-Side Code
Contents:
Lesson 1: Developing Web Parts

Lesson 2: Using Event Receivers

Lesson 3: Using Timer Jobs

Lesson 4: Storing Configuration Data

Module Review and Takeaways

11

5-2 Developing Microsoft SharePoint 2013 Core Solutions

Lesson 1

Developing Web Parts


Contents:
Demonstration: Creating a Visual Web Part

Working with Server-Side Code 5-3

Demonstration: Creating a Visual Web Part


Demonstration Steps
1.

Start the 20488B-LON-SP-05 virtual machine.

2.

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

3.

On the Start screen, click Desktop.

4.

On the desktop, on the taskbar, click File Explorer.

5.

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

6.

If you are prompted to choose a program to open the file, click Visual Studio 2012.

7.

In Visual Studio, in Solution Explorer, right-click VisualWebPart, point to Add, and then click New
Item.

8.

In the Add New Item - VisualWebPart dialog box, click Visual Web Part, and then click Add.

9.

In Solution Explorer, point out the two .cs code-behind files.

10. Double-click VisualWebPart1.ascx.cs. Explain that students should add their logic to this class.
11. In Solution Explorer, double-click VisualWebPart1.ascx.g.cs. Explain that this class contains autogenerated code, and is updated by Visual Studio. Make sure students are aware that they should not
edit this file. Point out that this is a partial class and is merged with the other code file when the class
is compiled.
12. On the VisualWebPart1.ascx tab, click Design.
13. From the Toolbox, drag a Button to the design canvas.
14. In Properties, in the Text box, type Click Me.
15. On the design canvas, double-click the button.
16. Point out that the event handler is added to the code-behind file, similar to developing an ASP.NET
web application.
17. Right-click the line that contains the opening brace for the Button1_Click method, point to
Breakpoint, and then click Insert Breakpoint.
18. On the DEBUG menu, click Start Debugging.
19. In the Debugging Not Enabled dialog box, click OK.
20. 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.
21. If a Microsoft Visual Studio dialog box appears, click Yes.
22. In Internet Explorer, on the Contoso Development Site, on the ribbon, on the PAGE tab, click Edit.
23. On the ribbon, on the INSERT tab, click Web Part.
24. In the Categories list, click Custom.
25. Under Parts, click VisualWebPart - VisualWebPart1, and then click Add.
26. On the ribbon, click SAVE.
27. In the VisualWebPart - VisualWebPart1 Web Part, click Click Me.
28. In Visual Studio, point out that the breakpoint has been hit, and then click Continue.
29. Close Internet Explorer.

5-4 Developing Microsoft SharePoint 2013 Core Solutions

30. Close Visual Studio.

Working with Server-Side Code 5-5

Lesson 2

Using Event Receivers


Contents:
Resources

5-6 Developing Microsoft SharePoint 2013 Core Solutions

Resources
Introduction to Event Receivers
Additional Reading: For more information about events you can handle in SharePoint,
see Using Event Receivers in SharePoint Foundation (Part 1 of 2) at
http://go.microsoft.com/fwlink/?LinkID=306990.

Working with Server-Side Code 5-7

Lesson 3

Using Timer Jobs


Contents:
Resources
Demonstration: Examining Timer Job Schedules

7
7

5-8 Developing Microsoft SharePoint 2013 Core Solutions

Resources
Developing a Work Item Timer Job
Additional Reading: For more information about the AddWorkItem method, see
SPSite.AddWorkItem method at http://go.microsoft.com/fwlink/?LinkID=307045.

Demonstration: Examining Timer Job Schedules


Demonstration Steps
1.

Start the 20488B-LON-SP-05 virtual machine.

2.

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

3.

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

4.

On the Central Administration website, click Monitoring.

5.

On the Monitoring page, under Timer Jobs, click Review job definitions.

6.

On the Job Definitions page, point out the standard timer jobs that are used by SharePoint. Point
out that in addition to providing extensibility for developers, SharePoint also uses timer jobs
extensively for internal operations.

7.

Click App Installation Service.

8.

On the Edit Timer Job page, point out the recurring schedule, and the Run Now button.

9.

Close Internet Explorer.

10. On the Start screen, type Services, and then click Services.
11. In Services, double-click the SharePoint Timer Service.
12. In the SharePoint Timer Service Properties (Local Computer) dialog box, point out that the
internal service name is SPTimerV4. Explain the importance of this for when you control services
from a command line.
13. Point out the path to executable, and the executable name OWSTIMER.exe. Remind students that
timer jobs run in this process and do not have a web context.
14. On the Log On tab, point out that this service runs under the farm account credentials. Explain that,
by default, this gives timer jobs full access to the farm, including write permissions on the
configuration database.
15. Click OK.
16. Close Services.

Working with Server-Side Code 5-9

Lesson 4

Storing Configuration Data


Contents:
Resources

5-10 Developing Microsoft SharePoint 2013 Core Solutions

Resources
Manipulating Web.config Files
Additional Reading: For more information about how to add entries to Web.config files,
see How to: Add and Remove Web.config Settings Programmatically at
http://go.microsoft.com/fwlink/?LinkID=307046.

Storing Hierarchical Data


Additional Reading: The SharePoint Guidance Library includes a reusable component
named the Application Setting Manager. The Application Setting Manager enables you to store
hierarchical configuration data by using alternative data stores, such as property bags. For more
information about the Application Setting Manager, see The Application Setting Manager at
http://go.microsoft.com/fwlink/?LinkID=307047.

Working with Server-Side Code 5-11

Module Review and Takeaways


Review Question(s)
Question: A visual Web Part cannot be installed in a sandboxed solution.
( ) True
( ) False
Answer:
( ) True
() False
Question: Which of the following identifies the default synchronization for events?
( ) Both before and after events run synchronously.
( ) Both before and after events run asynchronously.
( ) Before events run synchronously, and after events run asynchronously.
( ) Before events run asynchronously, and after events run synchronously.
( ) Before events run synchronously, after events do not have a default synchronization.
Answer:
( ) Both before and after events run synchronously.
( ) Both before and after events run asynchronously.
() Before events run synchronously, and after events run asynchronously.
( ) Before events run asynchronously, and after events run synchronously.
( ) Before events run synchronously, after events do not have a default synchronization.
Question: Timer jobs run with full control, in a separate process from the web worker process.
( ) True
( ) False
Answer:
() True
( ) False

5-12 Developing Microsoft SharePoint 2013 Core Solutions

Question: Which of the following statements is not true about storing configuration data in a property
bag?
( ) Properties stored in a property bag can only be accessed by the process that added them to the
property bag.
( ) Sandboxed solutions can use property bags.
( ) Property bags can store any object that can be serialized as XML.
( ) Configuration values stored in a property bag are saved in the SharePoint databases.
( ) A property bag is implemented as a hash table, which stores key and value pairs.
Answer:
() Properties stored in a property bag can only be accessed by the process that added them to
the property bag.
( ) Sandboxed solutions can use property bags.
( ) Property bags can store any object that can be serialized as XML.
( ) Configuration values stored in a property bag are saved in the SharePoint databases.
( ) A property bag is implemented as a hash table, which stores key and value pairs.

Managing Identity and Permissions 6-1

Module 6
Managing Identity and Permissions
Contents:
Lesson 1: Understanding Identity Management in SharePoint 2013

Lesson 2: Managing Permissions in SharePoint 2013

Lesson 3: Configuring Forms-Based Authentication

Lesson 4: Customizing the Authentication Experience

Module Review and Takeaways

11

Lab Review Questions and Answers

12

6-2 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 1

Understanding Identity Management in SharePoint


2013
Contents:
Resources

Managing Identity and Permissions 6-3

Resources
Authentication in SharePoint
Best Practice: Always use claims authentication mode unless you have some custom
component that cannot be used with claims authentication. Classic authentication is only
supported in SharePoint 2013 for backwards compatibility with custom components written for
earlier versions of SharePoint.
Additional Reading: For more information on how to create web applications that use
classic mode authentications, see Create web applications that use classic mode authentication in
SharePoint 2013 at http://go.microsoft.com/fwlink/?LinkID=313080.

Impersonation
Best Practice: The entire security infrastructure relies on permissions applied to security
principals such as user accounts and groups. When you use impersonation carelessly, it is possible
to compromise this infrastructure. You are responsible for any security breaches that result from
impersonation. Ensure that you use impersonation only when it is absolutely necessary and
ensure that you properly validate user input.

Common Issues and Troubleshooting Tips


Common Issue

Troubleshooting Tip

Elevated privileges do not apply to an


SPSite object you obtain outside the
RunWithElevatedPrivileges method.

Elevated privileges only apply to SPSite


objects that you obtain within the method.
Always obtain a new SPSite object when
you need one in a
RunWithElevatedPrivileges method.

Elevated privileges do not apply if you use


the SPContext.Current.Site property to
obtain the site collection.

SPContext.Current.Site always returns the


site collection in the security context of the
current user, even if the code is inside the
RunWithElevatedPrivileges method.
Instead use SPSite constructor to obtain
the site collection, as in the above example.

Updates to items do not apply.

If you want to use the Update method to


save changes to any SharePoint item within
the RunWithElevatedPrivileges method,
you must set the
SPSite.AllowUnsafeUpdates property to
true. Ensure you set this property back to
false after you have completed the
updates.

6-4 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 2

Managing Permissions in SharePoint 2013


Contents:
Resources

Managing Identity and Permissions 6-5

Resources
Managing Access to Resources
Best Practice: If you create many role assignments on multiple lists, libraries, items, and
other securable object at different levels in the hierarchy, you can create a very complex
permissions configuration. This can be difficult to administer because, when there is incorrect
assignment, it can be difficult to diagnose which role assignment on which securable object has
caused the problem. Keep permissions simple by using inheritance as much as possible and
assigning a small number of at the highest level in the hierarchy. Also, carefully document the
role assignments you create.

6-6 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 3

Configuring Forms-Based Authentication


Contents:
Resources

Managing Identity and Permissions 6-7

Resources
Forms-Based Authentication Overview
Additional Reading: For more information on configuring SSL for SharePoint, see
Configure SSL for SharePoint 2013 at http://go.microsoft.com/fwlink/?LinkID=311820.

6-8 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 4

Customizing the Authentication Experience


Contents:
Resources
Demonstration: A Custom Claims Provider

10
10

Managing Identity and Permissions 6-9

Resources
Creating a Claims Provider
Additional Reading: For more information on how to create a custom claims provider in
SharePoint 2013, see How to: Create a claims provider in SharePoint 2013 at
http://go.microsoft.com/fwlink/?LinkID=311821.

Demonstration: A Custom Claims Provider


Demonstration Steps
1.

Start the 20488B-LON-SP-06 virtual machine.

2.

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

3.

On the Windows Start screen, click Computer.

4.

Browse to E:\LabFiles\LabB\Solution\ContosoClaimsProvider folder.

5.

Double-click ContosoClaimsProvider.sln.

6.

In the Solution Explorer, double-click ContosoClaimsProvider.cs.

7.

In the ContosoClaimsProvider.cs code file, locate the following line of code:


protectedoverridevoidFillClaimsForEntity(Uricontext,SPClaimEntityentity,List<SPClaim>
claims)

8.

Right-click the located code, click Breakpoint, and then click Insert breakpoint.

9.

Locate the following line of code:


protectedoverridevoidFillSearch(Uricontext,string[]entityTypes,stringsearchPattern,
stringhierarchyNodeID,intmaxCount,SPProviderHierarchyTreesearchTree)

10. In the Windows Start page, click SharePoint 2013 Management Shell.
11. In Visual Studio, on the DEBUG menu, click Start Debugging.
12. If a Debugging Not Enabled dialog box appears, click OK.
13. Before you log on to SharePoint, switch to Visual Studio.
14. On the DEBUG menu, click Attach to Process.
15. Select the Show processes from all users checkbox.
16. In the Available Processes list, click the w3wp.exe process with the username CONTOSO\SPFarm.
17. Click Attach, and then in the Attach Security Warning dialog, click Attach.
18. Switch back to Internet Explorer.
19. In the Windows Security dialog, in the User name box, type Administrator.
20. Visual Studio interrupts execution in the FillClaimsForEntity method. Explain that this method
executes whenever a user authenticates with SharePoint and adds claims to the user token.
21. In Internet Explorer, click the Settings icon, and then click Site settings.
22. Under Users and Permissions, click Site permissions.

6-10 Developing Microsoft SharePoint Server 2013 Core Solutions

23. Click Contoso Development Site Visitors.


24. Click New.
25. In the Add people to the Contoso Development Site Visitors group box, type North.
26. Visual Studio interrupts execution in the FillSearch method. Explain that this method executes
whenever a user searches for a user or group in the People Picker control.
27. On the DEBUG menu, click Delete All Breakpoints.
28. In the Microsoft Visual Studio dialog box, click Yes.
29. Click North America and then click Share.
30. Close Internet Explorer.
31. Close Visual Studio.

Managing Identity and Permissions 6-11

Module Review and Takeaways


Best Practice
By using custom claim providers to restrict access to resources, you can secure your SharePoint farm and
comply with legislation in your legal jurisdiction without using or publishing confidential information
about your users.

Review Question(s)
Question: You are writing a SharePoint farm solution that must reassign permissions for the Financials
library. The farm solution is deployed under the security context of your personal user account. You find
that the solution is prevented from reassigning the permissions required. How can you ensure that the
solution can always overcome these restrictions?
Answer: Use the RunWithElevatedPrivileges method to execute the code as the SharePoint
system account.
Question: True or false: To enable SharePoint to authenticate user credentials against a custom user store,
you must create a custom FBA role provider.
( ) True
( ) False
Answer:
( ) True
() False

6-12 Developing Microsoft SharePoint Server 2013 Core Solutions

Lab Review Questions and Answers


Lab A: Managing Permissions Programmatically in SharePoint 2013
Question and Answers
Lab Review
Question: In the Task 2, when you called the BreakRoleInheritance method, you passed the value false.
What would happen if you passed the value true instead?
Answer: If you passed the value true, role inheritance is broken, but the initial permissions for
the library are copied from the parent site.
Question: In Task 4, you granted Contribute permissions to members of the Managers AD DS security
group. What other method could you use to grant this permission when permission inheritance is
enabled?
Answer: You could add the Managers security group to the Site Members SharePoint group,
which has the Contribute permission level by default.

Lab B: Creating and Deploying a Custom Claims Provider


Question and Answers
Question: Why can you not use a class that derives from SPFeatureReceiver to deploy a claims provider?
Answer: You must derive the feature receiver from the SPClaimProviderFeatureReceiver class
in order to deploy a claims provider because specialized properties such as
ClaimProviderAssembly and ClaimProviderDisplayName are not supported by
SPFeatureReceiver.
Question: You want to create a claims provider that augments claims in the user's security token but does
not show up in the People Picker dialog. Which methods should you implement in the SPClaimProvider
class?
Answer: You should implement FillClaimTypes, FillClaimValues, FillClaimsForEntity, and
FillEntityTypes.

Introducing Apps for SharePoint 7-1

Module 7
Introducing Apps for SharePoint
Contents:
Lesson 1: Overview of Apps for SharePoint

Lesson 2: Developing Apps for SharePoint

Module Review and Takeaways

Lab Review Questions and Answers

7-2 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 1

Overview of Apps for SharePoint


Contents:
Resources

Introducing Apps for SharePoint 7-3

Resources
Developer Tools and Technologies
Additional Reading: For more information about Napa, see Create apps for Office and
SharePoint by using "Napa" Office 365 Development Tools at
http://go.microsoft.com/fwlink/?LinkID=307093.

7-4 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 2

Developing Apps for SharePoint


Contents:
Resources
5
Demonstration: How to Create a SharePoint App from a Visual Studio Template5

Introducing Apps for SharePoint 7-5

Resources
Licenses for Apps for SharePoint
Additional Reading: For more information about the licensing framework and the
mechanisms by which users acquire and renew licenses, see Licensing apps for Office and
SharePoint at http://go.microsoft.com/fwlink/?LinkID=307094.
Additional Reading: To learn more about test licenses and how to set them up in your
test environment, see How to: Add license checks to your app for SharePoint at
http://go.microsoft.com/fwlink/?LinkID=307095.

Demonstration: How to Create a SharePoint App from a Visual Studio


Template
Demonstration Steps
1.

Start the 20488B-LON-SP07 virtual machine.

2.

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

3.

On the Start screen, click Visual Studio 2012.

4.

In Visual Studio, click File, click New, and then click Project.

5.

In the tree view on the left, navigate to Templates/Visual C#/Office/SharePoint/Apps.

6.

In the list of templates, click App for SharePoint 2013.

7.

In the Name text box, type HelloWorldApp, and then click OK.

8.

In the New App for SharePoint dialog box, in the What is the name of your app for SharePoint
text box, type Hello World.

9.

In the What SharePoint site do you want to use for debugging your app text box, type
http://dev.contoso.com and then click Validate.

10. In the Connection Successful message box, click OK.


11. In Solution Explorer, expand the Features folder.
12. Explain to the students that Feature1 is used to deploy lists, libraries, and other SharePoint content to
the app web.
13. Expand the Content folder.
14. Explain to the students that app.css is the default style sheet for every page in the app.
15. Expand the Images folder.
16. Explain to the students that AppIcon.png is the default icon that is displayed in the host web for the
app. This is a good folder to store other graphics files.
17. Expand the Pages Folder.
18. Expand the Script folder, and then double-click the App.js folder
19. Explain to the students that the default JavaScript code displays the current user's name at in the
page element with ID message. This is a good file to place core custom client-side code.
20. In Solution Explorer, double-click default.aspx.

7-6 Developing Microsoft SharePoint Server 2013 Core Solutions

21. In the Default.aspx code window, locate the following line of code:
PageTitle

22. Replace the located code with the following code:


23. Click Debug, and then click Start Debugging.
24. If the Windows Security dialog box appears, in the User name text box, type
CONTOSO\Administrator.
25. In the Password text box, type Pa$$w0rd and then click OK.
26. At the upper-left of the page, click Contoso Development Site.
27. In the Quick Launch on the left, click Site Contents.
28. Close Internet Explorer.
29. Close Visual Studio.

Introducing Apps for SharePoint 7-7

Module Review and Takeaways


Best Practice
If you can develop your custom functionality as an app, you should do so in preference to developing
farm solutions or sandboxed solutions. The reason for this recommendation is that apps have better
isolation, and therefore greater stability, than solutions. Also, a completed app can be marketed in the
Office Store.

Best Practice
Always use JavaScript in combination with script libraries for client-side code. JavaScript is widely
supported and script libraries help to circumvent awkward browser differences that can needlessly
increase a developer's workload.

Review Question(s)
Question: Your company has created an app that manages company assets such as equipment. You have
been asked to integrate this with the host web so that users can place the app on a Web Part page. What
kind on entry point does this require?
Answer: An app part entry point.

Tools
Visual Studio. This is the primary IDE to use for developing apps of all kinds.
Napa. This is a web-based IDE that is designed to make it very easy to create simple apps.

Common Issues and Troubleshooting Tips


Common Issue
When you call the jQuery() or $()
function, you see an error message.

Troubleshooting Tip
The jQuery() or $() function is a core jQuery
function. If you cannot call it, your app
probably does not include the jQuery
library. To fix this, include a <script>
element that links to jQuery in your app
page. You will see more information about
linking to jQuery in Module 9.

7-8 Developing Microsoft SharePoint Server 2013 Core Solutions

Lab Review Questions and Answers


Lab: Creating a Site Suggestions App
Question and Answers
Lab Review
Question: In Exercise 2, Task 3 you added styles to the App.css style sheet. How would the app function if
you had not performed this step?
Answer: The app would function correctly, but the layout and presentation of the user interface
elements may look incorrect.
Question: When you click a suggestion in the list, the suggestion fades in smoothly. How is this fade
achieved in the code?
Answer: The following line of code implements the fade in:
$('#item-display').fadeIn('fast');

Client-Side SharePoint Development 8-1

Module 8
Client-Side SharePoint Development
Contents:
Lesson 2: Using the Client-Side Object Model for JavaScript

Module Review and Takeaways

Lab Review Questions and Answers

8-2 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 2

Using the Client-Side Object Model for JavaScript


Contents:
Demonstration: How to Use load and loadQuery

Client-Side SharePoint Development 8-3

Demonstration: How to Use load and loadQuery


Demonstration Steps
1.

Connect to the 20488B-LON-SP-08 virtual machine.

2.

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

3.

Start File Explorer.

4.

Navigate to E:\Democode\Starter\LoadItemsDemo.

5.

Double-click LoadItemsDemo.sln.

6.

If the How do you want to open this type of file (.sln)? dialog box appears, click Visual Studio
2012. In Solution Explorer, expand the Scripts folder, and then double-click App.js.

7.

Locate the following code:


vargetItemsWithLoad=function(){
};

8.

Place the cursor within the located function.

9.

Type the following code:


vardiscussionList=context.get_web().get_lists().getByTitle('Discussion');
context.load(discussionList);

10. Press Enter.


11. Type the following code:
varitems=discussionList.getItems('');

12. Press Enter.


13. Type the following code:
context.load(items);

14. Press Enter.


15. Type the following code:
context.executeQueryAsync(function(){
});

16. Place the cursor within the anonymous function you just created.
17. Type the following code:
varenumerator=items.getEnumerator();

18. Press Enter.


19. Type the following code:
while(enumerator.moveNext()){
}

20. Place the cursor within the while loop you just created.

8-4 Developing Microsoft SharePoint Server 2013 Core Solutions

21. Type the following code:


varitem=enumerator.get_current();

22. Press Enter.


23. Type the following code:
alert("DiscussionItem:"+item.get_item("Title"));

24. Locate the following code:


vargetItemsWithLoadQuery=function(){
};

25. Place the cursor within the located function.


26. Type the following code:
vardiscussionList=context.get_web().get_lists().getByTitle('Discussion');
context.load(discussionList);

27. Press Enter.


28. Type the following code:
varitems=discussionList.getItems('');

29. Press Enter.


30. Type the following code:
varresults=context.loadQuery(items);

31. Press Enter.


32. Type the following code:
context.executeQueryAsync(function(){
});

33. Place the cursor within the anonymous function you just created.
34. Type the following code:
results.forEach(function(item){
})

35. Place the cursor within the forEach loop you just created.
36. Type the following code:
alert("DiscussionItem:"+item.get_item("Title"));

37. On the DEBUG menu, click Start Debugging.


38. If the Windows Security dialog box appears, in the Username box, type Administrator.
39. In the Password box, type Pa$$w0rd.
40. Click Get Items with Load.

Client-Side SharePoint Development 8-5

41. Click OK for each result.


42. Click Get Items with LoadQuery.
43. Click OK for each result.
44. Close Internet Explorer.

8-6 Developing Microsoft SharePoint Server 2013 Core Solutions

Module Review and Takeaways


Review Question(s)
Question: You are writing a SharePoint-hosted app and you want to access the items in a SharePoint list.
Which of the following technologies can you use to write your code:
The JavaScript CSOM
The REST API
The .NET Managed CSOM
Answer: You can use the JavaScript CSOM or the REST API in this app.

Common Issues and Troubleshooting Tips


Common Issue
A REST API request that modifies a
SharePoint item generates an error.

Troubleshooting Tip
If you do not include the form digest in
your REST request headers, SharePoint will
deny your request to prevent malicious
attacks.

Client-Side SharePoint Development 8-7

Lab Review Questions and Answers


Lab A: Using the Client-Side Object Model for Managed Code
Question and Answers
Lab Review
Question: In Exercise 2, how did you ensure that all pages in the remote web could locate the app web in
SharePoint to read or write data?
Answer: You wrote code that stored the SPAppWebUrl query string parameter in a Session
variable.

Lab B: Using the REST API with JavaScript


Question and Answers
Question: In the code that retrieves and displays votes, how did you ensure only votes for the current
suggestion are retrieved from SharePoint?
Answer: You used the $filter OData operator in the REST URL that you sent to the SharePoint
REST API.
Question: In Exercise 2, you passed a form digest with REST request. Why was this form digest
unnecessary in the REST request you formulated in Exercise 3?
Answer: Form digests are only necessary with data modification REST requests, such as POST and
PATCH requests.

Developing Remote-hosted Apps for SharePoint 9-1

Module 9
Developing Remote-hosted Apps for SharePoint
Contents:
Lesson 2: Configuring Remote-Hosted Apps

Module Review and Takeaways

Lab Review Questions and Answers

9-2 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 2

Configuring Remote-Hosted Apps


Contents:
Resources

Developing Remote-hosted Apps for SharePoint 9-3

Resources
Requesting App Permissions
Additional Reading: For more information about app permission request scopes, see
Plan app permissions management in SharePoint 2013 at
http://go.microsoft.com/fwlink/?LinkID=307096.

9-4 Developing Microsoft SharePoint Server 2013 Core Solutions

Module Review and Takeaways


Best Practice
Use the Chrome Control whenever you want your app to blend with the host web's look and feel. You
cannot be sure that the host web will always use the familiar SharePoint look and feel, so if you hard code
the usual SharePoint design into your app, the app may not look like the customer's host web. The
Chrome Control avoids this problem by downloading the style sheet and headers elements from the host
web at run time.

Best Practice
If you want to use an S2S trust relationship with a provider-hosted app, purchase an X.509 certificate from
a globally-trusted certificate authority. If you use a certificate you created yourself, customers see error
messages and warnings when they install your app that discourage them from proceeding with the
installation.

Review Question(s)
Question: You have noticed that many of the Office 365 customers in your industry want extra customer
relationship management functionality in their SharePoint online tenancy. You decide to build an app to
satisfy these specialized requirements. What hosting model is easiest for you to build?
Answer: An auto-hosted app is the easiest type of app to build
Question: True or False: The Chrome Control can only be used with provider-hosted apps.
( ) True
( ) False
Answer:
( ) True
() False

Developing Remote-hosted Apps for SharePoint 9-5

Question: You are building a provider-hosted app, which you want to publish to the Office Store. You
want customers with on-premises SharePoint farms to be able to use your app and you do not want to
use a Windows Azure account. How should you configure authentication?
( ) You do not need to configure authentication because each user's SharePoint account can be used to
access all resources.
( ) Use OAuth authentication with an X.509 certificate to create the trust relationship.
( ) Use S2S authentication with an X.509 certificate to create the trust relationship.
( ) Use an isolated SQL Database for authentication with an X.509 certificate to create the trust
relationship
( ) Use OAuth authentication with the ACS service, which has a default trust relationship with Office 365
Answer:
( ) You do not need to configure authentication because each user's SharePoint account can be
used to access all resources.
( ) Use OAuth authentication with an X.509 certificate to create the trust relationship.
() Use S2S authentication with an X.509 certificate to create the trust relationship.
( ) Use an isolated SQL Database for authentication with an X.509 certificate to create the trust
relationship
( ) Use OAuth authentication with the ACS service, which has a default trust relationship with
Office 365

9-6 Developing Microsoft SharePoint Server 2013 Core Solutions

Lab Review Questions and Answers


Lab A: Configuring a Provider-Hosted SharePoint App
Question and Answers
Lab Review
Question: The certificate you created and used in this lab to configure the S2S trust relationship is not
suitable for a completed provider-hosted app that is published to the Office Store. Why is this?
Answer: The certificate you created and used in this lab is not trusted by all users of the Office
Store.
Question: In the default code for the Contoso Ledgers app, what method on the TokenHelper class is
used to obtain the client context object?
Answer: The default code uses the
TokenHelper.GetS2SClientContextWithWindowsIdentity() method to obtain the client
context object.

Lab B: Developing a Provider-Hosted SharePoint App


Question and Answers
Question: The Contoso Ledgers app you created accessed data in the host web and displayed it to the
user. If you created the necessary lists in the app web, what changes could you make to your code?
Answer: You would not need to add AppPermissionRequest elements to the app manifest file
if the app only accessed lists in the app web.

Publishing and Distributing Apps 10-1

Module 10
Publishing and Distributing Apps
Contents:
Lesson 2: Understanding App Packages

Lesson 3: Publishing Apps

Module Review and Takeaways

Lab Review Questions and Answers

10-2 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 2

Understanding App Packages


Contents:
Demonstration: Exploring an App Package

Publishing and Distributing Apps 10-3

Demonstration: Exploring an App Package


Demonstration Steps
1.

Start the 20488B-LON-SP-10 virtual machine, if it is not already running.

2.

Log on as CONTOSO\Administrator, with the password Pa$$w0rd.

3.

Open File Explorer, and browse to E:\Democode.

4.

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

5.

Select the file name extension .app, type .zip, and then press Enter.

6.

In the Rename dialog box, click Yes.

7.

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

8.

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

9.

Double-click AppIcon.png.
Note: Windows Photo Viewer displays the app icon file.

10. Switch to File Explorer.


11. Right-click AppManifest.xml, point to Open with, and then click Microsoft Visual Studio 2012.
Note: Visual Studio displays the contents of the app manifest.
12. Switch to File Explorer.
13. Right-click SiteSuggestionsApp.wsp, and then click Rename.
14. Select the file name extension .wsp, type .cab, and then press Enter.
15. In the Rename dialog box, click Yes.
16. Double-click SiteSuggestionsApp.cab.
17. Right-click Feature.xml, and then click Extract.
18. In the Select a Destination dialog box, browse to E:\Democode, and then click Extract.
19. In File Explorer, browse to the folder E:\Democode.
20. Right-click Feature.xml, point to Open with, and then click Microsoft Visual Studio 2012.
21. Close Visual Studio.
22. Close File Explorer.
23. Close Windows Photo Viewer.

10-4 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 3

Publishing Apps
Contents:
Resources

Publishing and Distributing Apps 10-5

Resources
Publishing to the Office Store
Additional Reading: For more information about apps for SharePoint in the Office Store,
see Office Store at http://go.microsoft.com/fwlink/?LinkID=307097.
Additional Reading: For information about app validation policies, see Validation policies
for the apps submitted to the Office Store (Version 1.4) at
http://go.microsoft.com/fwlink/?LinkID=307098.

10-6 Developing Microsoft SharePoint Server 2013 Core Solutions

Module Review and Takeaways


Best Practice
Consider publishing a finished app in the Office Store, even if the app was developed for a specific
customer with unusual requirements. If you publish the app to the global SharePoint community in this
way, you can generate extra return on the investment made by you or by the customer who paid for the
app development.

Best Practice
Take care to set version numbers in the app manifest file precisely and logically. The upgrade process
relies on these version numbers. If you do not manage the version numbers correctly, users will not be
prompted to install your new functionality and will continue to use an out-of-date app.

Review Question(s)
Question: You have been hired by a firm of lawyers to create a specialized document management
SharePoint app. The app is SharePoint-hosted and enables users to track the progress of cases through
multiple courts. Should you publish the app in an app catalog or the Office Store?
Answer: You should consider publishing the app in both an app catalog and the Office Store.
Question: True or False: To prevent any further use of an app, you can remove it from the app catalog or
Office Store.
( ) True
( ) False
Answer:
( ) True
() False
Question: Which of the following service applications must be in place for you to publish and deploy
apps from an app catalog?
( ) The Application Discovery and Load Balancer Service
( ) The Site Subscription Settings Service
( ) The Managed Metadata Service
( ) The Secure Store Service
( ) The Security Token Service
Answer:
( ) The Application Discovery and Load Balancer Service
() The Site Subscription Settings Service
( ) The Managed Metadata Service
( ) The Secure Store Service
( ) The Security Token Service

Publishing and Distributing Apps 10-7

Question: True or False: The app package for an auto-hosted SharePoint app must include a SharePoint
solution (.wsp) file.
( ) True
( ) False
Answer:
( ) True
() False

10-8 Developing Microsoft SharePoint Server 2013 Core Solutions

Lab Review Questions and Answers


Lab A: Publishing an App to a Corporate Catalog
Question and Answers
Lab Review
Question: Where does the app catalog look for the version number of the app you upload?
Answer: In the app manifest file.
Question: A developer, working on a new app for the marketing department, has shown a user the latest
features of the app, which is approaching completion. The user wants to install the app in the marketing
site, but when he clicks add an app, he cannot find the app in any of the lists. What should you tell the
user?
Answer: Tell the user that the app is not yet published, so it cannot yet be located in the app
catalog or installed in a site.

Lab B: Installing, Updating, and Uninstalling Apps


Question and Answers
Question: The Site Suggestions app is a SharePoint-hosted app. When a user installs the app, where does
the app create resources?
Answer: The app creates an app web and places all resources in that app web.
Question: When you remove an app from the app catalog, what happens to the deployed instances of
that app?
Answer: Nothing. Deployed instances of the app are not removed when an app is removed from
the app catalog. However, new instances of the app cannot be installed.

Automating Business Processes 11-1

Module 11
Automating Business Processes
Contents:
Lesson 1: Understanding Workflow in SharePoint 2013

Lesson 2: Building Workflows by using Visio 2013 and SharePoint Designer 2013

Lesson 3: Developing Workflows in Visual Studio 2012

Module Review and Takeaways

11-2 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 1

Understanding Workflow in SharePoint 2013


Contents:
Resources

Automating Business Processes 11-3

Resources
Introduction to the SharePoint Workflow Platform
Additional Reading: For more information about workflow interop, see Use workflow
interop for SharePoint 2013 at http://go.microsoft.com/fwlink/?LinkID=307099.
Additional Reading: For more information about the Workflow Service Manager classes,
see System.Workflow Namespaces at http://go.microsoft.com/fwlink/?LinkID=307100.

11-4 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 2

Building Workflows by using Visio 2013 and


SharePoint Designer 2013
Contents:
Resources
Demonstration: Creating Workflows in SharePoint Designer

5
5

Automating Business Processes 11-5

Resources
Creating Workflows by Using Visio
Additional Reading: For a complete list of the available actions, see Action shapes at
http://go.microsoft.com/fwlink/?LinkID=307101.
Additional Reading: For a complete list of the available conditions, see Condition shapes
at http://go.microsoft.com/fwlink/?LinkID=307102.

Demonstration: Creating Workflows in SharePoint Designer


Demonstration Steps
1.

Start the 20488B-LON-SP-11 virtual machine.

2.

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

3.

On the Start screen, type SharePoint Designer 2013, and then click SharePoint Designer 2013.

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.

In the Windows Security dialog box, in the User name box, type Dominik, in the Password box,
type Pa$$w0rd, and then click OK.

7.

In the Navigation pane, click Lists and Libraries.

8.

On the ribbon, on the LISTS AND LIBRARIES tab, in the New group, click Custom List.

9.

In the Create list or document library dialog box, in the Name box, type Demo List, and then click OK.

10. In the Navigation pane, click Workflows.


11. On the ribbon, on the WORKFLOWS tab, in the New group, click List Workflow, and then click
Demo List.
12. In the Create List Workflow - Demo List dialog box, in the Name box, type Demo Workflow, and
then click OK.
13. Click (Start typing or use the Insert group on the ribbon.), type Assign a task, and then press Enter.
14. Click this user.
15. In the Assign a Task dialog box, in the Participant box, type Dominik, in the Task Title box, type
Demo task, and then click OK.
16. On the ribbon, on the WORKFLOW tab, in the Manage group, click Views, and then click Visual
Designer.
17. In the Shapes pane, click Actions - SharePoint 2013 Workflow, and then drag Log to history list
and drop it to the right of the Assign a task action.
18. Click the Log to history action that you just added, click the SharePoint Designer Properties
button that appears in the lower-left of the action, and then click Message.
19. In the Log to History List Properties dialog box, type Task assigned, and then click OK.
20. On the ribbon, on the WORKFLOW tab, in the Manage group, click Views, and then click TextBased Designer.

11-6 Developing Microsoft SharePoint Server 2013 Core Solutions

21. Review the log action that has been added.


22. On the ribbon, on the WORKFLOW tab, in the Save group, click Check for Errors.
23. In the Microsoft SharePoint Designer dialog box, click OK.
24. On the ribbon, on the WORKFLOW tab, in the Manage group, click Workflow Settings.
25. In the Start Options group, select the Start workflow automatically when an item is created check box.
26. On the ribbon, on the WORKFLOW SETTINGS tab, in the Save group, click Save.
27. On the ribbon, on the WORKFLOW SETTINGS tab, in the Save group, click Publish.
28. On the Start screen, click Internet Explorer.
29. In the Windows Security dialog box, in the User name box, type Dominik, in the Password box,
type Pa$$w0rd, and then click OK.
30. In SharePoint, in the Quick Launch menu, click Demo List.
31. Click new item, in the Title box, type Demo Item, and then click Save.
32. Next to Demo Item in the list, click the ellipsis, and then click Workflows.
33. Note that the Demo workflow has started.
34. Under Running Workflows, click Demo Workflow and note that a task has been assigned to
Dominik Dubicki.
35. Under Tasks, click Demo task. If there are no items under Tasks, refresh the page.
36. On the ribbon, on the VIEW tab, in the Manage group, click Edit Item.
37. Click Approved and when the Demo Workflow page loads, click Refresh.
38. Note that the workflow is now complete and the Task assigned message has been logged to the
Workflow History section.
39. Close Internet Explorer.
40. Close SharePoint Designer.

Automating Business Processes 11-7

Lesson 3

Developing Workflows in Visual Studio 2012


Contents:
Resources

11-8 Developing Microsoft SharePoint Server 2013 Core Solutions

Resources
Creating the actions4 File
Additional Reading: For more information about the attributes of the FieldBind
element, see FieldBind Element (WorkflowInfo) at http://go.microsoft.com/fwlink/?LinkID=307103.
Additional Reading: For more information about the attributes of the Parameter
element, see Parameter Element (WorkflowInfo) at
http://go.microsoft.com/fwlink/?LinkID=307104.

Automating Business Processes 11-9

Module Review and Takeaways


Review Question(s)
Question: Which type of workflow cannot be triggered by an event?
( ) List workflow
( ) Site workflow
( ) Reusable workflow
Answer:
( ) List workflow
() Site workflow
( ) Reusable workflow
Question: You are developing a workflow in Visio and have added an Assign a task shape to the
workflow. However, you cannot locate the Properties button to customize the task. What do you need to
do?
Answer: You must import the workflow into SharePoint Designer to access the properties of
workflow items.
Question: Which of the following controls can you use to call a method in a web service from a Visual
Studio workflow custom activity?
( ) Interop
( ) WorkflowInterop
( ) HttpSend
( ) WaitForCustomEvent
( ) FlowSwitch<T>
Answer:
( ) Interop
( ) WorkflowInterop
() HttpSend
( ) WaitForCustomEvent
( ) FlowSwitch<T>

Managing Taxonomy 12-1

Module 12
Managing Taxonomy
Contents:
Lesson 1: Managing Taxonomy in SharePoint 2013

Lesson 2: Working with Content Types

Module Review and Takeaways

12-2 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 1

Managing Taxonomy in SharePoint 2013


Contents:
Resources

Managing Taxonomy 12-3

Resources
Creating Site Columns Declaratively
Additional Reading: For comprehensive information about attributes and child elements,
see Field Element (Field) at http://go.microsoft.com/fwlink/?LinkID=307105.
Additional Reading: For more information about creating site columns declaratively, see
Field Definitions at http://go.microsoft.com/fwlink/?LinkID=307106.

12-4 Developing Microsoft SharePoint Server 2013 Core Solutions

Lesson 2

Working with Content Types


Contents:
Demonstration: Using the Visual Studio 2012 Content Type Designer

Managing Taxonomy 12-5

Demonstration: Using the Visual Studio 2012 Content Type Designer


Demonstration Steps
1.

Start the 20488B-LON-SP-12 virtual machine.

2.

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

3.

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

4.

In Visual Studio, on the start page, click New Project.

5.

In the New Project dialog box, in the navigation pane, expand Template, expand Visual C#, expand
Office/SharePoint, and then click SharePoint Solutions.

6.

In the center pane, click SharePoint 2013 - Empty Project.

7.

In the Name box, type ContentTypeDemo.

8.

In the Location box, type E:\Democode\, and then click OK.

9.

In the SharePoint Customization Wizard dialog box, in the What site do you want to use for
debugging box, type http://team.contoso.com.

10. Click Deploy as a farm solution, and then click Finish.


11. In Solution Explorer, right-click the ContentTypeDemo project node, point to Add, and then click
New Item.
12. In the Add New Item - ContentTypeDemo dialog box, click Site Column.
13. In the Name box, type ClientName, and then click Add.
14. In the Elements.xml file, amend the Field element as shown by the bolded text:
<Field
ID="{...}"
Name="ClientName"
DisplayName="ClientName"
Type="Text"

Required="TRUE"
Group="Contoso Columns">

</Field>

15. Save and close the Elements.xml file.


16. In Solution Explorer, right-click the ContentTypeDemo project node, point to Add, and then click
New Item.
17. In the Add New Item - ContentTypeDemo dialog box, click Site Column.
18. In the Name box, type PaymentDueDate, and then click Add.
19. In the Elements.xml file, amend the Field element as shown by the bolded text:
<Field
ID="{...}"
Name="PaymentDueDate"
DisplayName="PaymentDueDate"
Type="DateTime"

Format="DateOnly"
Required="TRUE"
Group="Contoso Columns">

</Field>

20. Save and close the Elements.xml file.

12-6 Developing Microsoft SharePoint Server 2013 Core Solutions

21. In Solution Explorer, right-click the ContentTypeDemo project node, point to Add, and then click
New Item.
22. In the Add New Item - ContentTypeDemo dialog box, click Site Column.
23. In the Name box, type Amount, and then click Add.
24. In the Elements.xml file, amend the Field element as shown by the bolded text:
<Field
ID="{...}"
Name="Amount"
DisplayName="Amount"

Type="Currency"
LCID="1033"
Required="TRUE"
Group="Contoso Columns">

</Field>

25. Save and close the Elements.xml file.


26. In Solution Explorer, right-click the ContentTypeDemo project node, point to Add, and then click
New Item.
27. In the Add New Item - ContentTypeDemo dialog box, click Content Type.
28. In the Name box, type Invoice, and then click Add.
29. In the SharePoint Customization Wizard dialog box, in the Which base content type should this
content type inherit from list, click Document, and then click Finish.
30. On the Columns tab, in the first row, type Client Name, and then press Tab three times.
31. In the second row, type Payment Due Date, and then press Tab three times.
32. In the third row, type Amount, and then press Tab three times.
33. On the Content Type tab, in the Description box, type Invoices sent to Contoso clients.
34. In the Group Name box, type Contoso Content Types.
35. On the FILE menu, click Save All, and then close the Invoice page.
36. In Solution Explorer, expand the Invoice node, and then double-click Elements.xml.
37. Review the ContentType element that Visual Studio has created for you. In particular, note that the
content type ID follows the inheritance pattern described in the previous topic.

Managing Taxonomy 12-7

Module Review and Takeaways

Question: Contoso uses two lists to manage invoices. The Invoice list contains general information, such
as the name of the client, the billing address, and the due date. The Invoice Items list contains more
detailed information about individual invoice lines, such as the product or service and the unit costs. You
want to link the two lists. How should you proceed?
Answer: You should add a lookup field to the Invoice Items list. The lookup field should look up
values from the Invoice list. You should use the ShowField attribute to indicate which field from
the Invoice list you want to select from in the Invoice Items list. You may also want to configure
a cascade delete rule, so that when you delete an item from the Invoice list, any corresponding
items in the Invoice Items list are also deleted.
Question: What are the advantages of creating a content type programmatically, rather than
declaratively?
Answer: Some developers consider the programmatic approach to be more intuitive and more
flexible, particularly if you want to modify or replace an existing content type. If you are creating
an app, the programmatic approach enables you to create content types on any web, whereas
the declarative approach constrains you to the app web.

Question: You have added a workflow association to a site content type. How do you ensure that the
workflow association is also applied to list content types?
Answer: If you are working in server-side code, use the
SPContentType.UpdateWorkflowAssociationsOnChildren method to apply the workflow
associations to list content types. If you are working in client-side code, use the
SP.ContentType.update method, and specify an argument value of true.

Managing Custom Components and Site Life Cycles 13-1

Module 13
Managing Custom Components and Site Life Cycles
Contents:
Lesson 1: Defining Custom Lists

Lesson 2: Defining Custom Sites

Lesson 3: Managing SharePoint Sites

Module Review and Takeaways

13-2 Developing Microsoft SharePoint 2013 Core Solutions

Lesson 1

Defining Custom Lists


Contents:
Resources

Managing Custom Components and Site Life Cycles 13-3

Resources
Developing List Definitions
Additional Reading: For more information about defining a list definition in a Feature
element manifest file, see ListTemplate Element (List Template) at
http://go.microsoft.com/fwlink/?LinkID=307083.
Additional Reading: For more information about defining a list schema, see List Schema
at http://go.microsoft.com/fwlink/?LinkID=307084.

13-4 Developing Microsoft SharePoint 2013 Core Solutions

Lesson 2

Defining Custom Sites


Contents:
Resources
Demonstration: Examining the Standard Site Definitions

5
6

Managing Custom Components and Site Life Cycles 13-5

Resources
Introduction to Site Definitions and Web Templates
Additional Reading: For more information about saving an existing site as a template,
see SPWeb.SaveAsTemplate method at http://go.microsoft.com/fwlink/?LinkID=307085.

Developing a Site Definition Declaratively


Additional Reading: For more information about the Webtemp*.xml file, see
Understanding WebTemp*.xml Files at http://go.microsoft.com/fwlink/?LinkID=307086.
Additional Reading: For information about when to create multiple site definitions, and
when a single site definition with multiple configurations would be more appropriate, see
Deciding Between Multiple Definitions or Multiple Configurations at
http://go.microsoft.com/fwlink/?LinkID=307087.
Additional Reading: For more information about developing a custom site definition, see
How To: Create a Custom Site Definition and Configuration at
http://go.microsoft.com/fwlink/?LinkID=307088.

Deploying Site Definitions


Additional Reading: For more information about locale IDs, see Locale IDs Assigned by
Microsoft at http://go.microsoft.com/fwlink/?LinkID=307089.

Demonstration: Examining the Standard Site Definitions


Demonstration Steps
1.

Start the 20488B-LON-SP-13 virtual machine if it is not already running.

2.

Log on as CONTOSO\Administrator, with the password Pa$$w0rd.

3.

On the Start screen, click Desktop.

4.

On the taskbar, click File Explorer.

5.

In File Explorer, browse to the C:\Program Files\Common Files\microsoft shared\Web Server


Extensions\15\TEMPLATE\1033\XML folder. Explain that all of the webtemp*.xml files are stored
in this folder.

6.

Double-click WEBTEMP.xml

7.

When prompted, click Microsoft Visual Studio 2012.

8.

In the WEBTEMP.xml file, point out the existing templates and configurations.

9.

Point out the STS template, and the Team Site and Blank Site configurations.

10. Close Visual Studio.


11. In File Explorer, browse to the C:\Program Files\Common Files\microsoft shared\Web Server
Extensions\15\TEMPLATE\SiteTemplates folder.

13-6 Developing Microsoft SharePoint 2013 Core Solutions

12. Point out the sts folder that corresponds with the STS template in the webtemp.xml file.
13. Browse to the sts folder.
14. Point out the aspx pages that are included in the site definition and then browse to the xml folder.
15. Double-click the ONET.XML file.
16. Point out the various aspects of the site definition, including the navigation bars, and document
templates.
17. Point out the Configurations element and child Configuration elements. Explain how the ID
attribute of each Configuration element corresponds with the configurations in the WEBTEMP.xml
file.
18. Point out how different configurations specify different child items (for example, lists and Features).
19. Close Visual Studio.
20. In File Explorer, browse to the C:\Program Files\Common Files\microsoft shared\Web Server
Extensions\15\TEMPLATE\1033\XML folder.
21. Double click the webtempdev.xml file.
22. Point out the Developer Site configuration. Explain that there is no corresponding folder in the
SiteTemplates folder for this configuration because this configuration is provisioned by using code.
Point out the ProvisionAssembly and ProvisionClass attributes, and explain that the corresponding
assembly is stored in the global assembly cache.
23. Close Visual Studio.

Managing Custom Components and Site Life Cycles 13-7

Lesson 3

Managing SharePoint Sites


Contents:
Resources

13-8 Developing Microsoft SharePoint 2013 Core Solutions

Resources
Provisioning Sites
Additional Reading: For more information about how to create a site collection by using
Windows PowerShell, see New-SPSite at http://go.microsoft.com/fwlink/?LinkID=307090.
Additional Reading: For more information about how to create a site by using Windows
PowerShell, see New-SPWeb at http://go.microsoft.com/fwlink/?LinkID=307091.

Host-named Site Collections


Additional Reading: For more information and considerations for when to use hostnamed site collections, see Host-names site collection architecture and deployment (SharePoint
2013) at http://go.microsoft.com/fwlink/?LinkID=307092.

Managing Custom Components and Site Life Cycles 13-9

Module Review and Takeaways


Review Question(s)
Question: Which of the following options accurately describes the process used by SharePoint when you
add a site content type to a list instance?
( ) SharePoint adds the site content type to the list.
( ) SharePoint creates a new content type, which is a copy of the original content type, and inherits from
the same parent content type as the site content type.
( ) SharePoint creates a new content type, which is a copy of the original content type, and inherits from
the site content type.
( ) SharePoint creates a new list-scoped content type, which inherits from the site content type, and adds
the new content type to the list.
( ) SharePoint creates a new, hidden, site-scoped content type, which inherits from the original site
content type, and adds the new content type to the list.
Answer:
( ) SharePoint adds the site content type to the list.
( ) SharePoint creates a new content type, which is a copy of the original content type, and
inherits from the same parent content type as the site content type.
( ) SharePoint creates a new content type, which is a copy of the original content type, and
inherits from the site content type.
() SharePoint creates a new list-scoped content type, which inherits from the site content type,
and adds the new content type to the list.
( ) SharePoint creates a new, hidden, site-scoped content type, which inherits from the original
site content type, and adds the new content type to the list.
Question: Which of the following items can you not include in a list schema?
( ) Fields
( ) Toolbars
( ) Content types
( ) Views
( ) Content/Data
Answer:
( ) Fields
( ) Toolbars
( ) Content types
( ) Views
() Content/Data

13-10 Developing Microsoft SharePoint 2013 Core Solutions

Question: Feature stapling adds a Feature to both existing and new sites that are based on the stapled
site definition.
( ) True
( ) False
Answer:
( ) True
() False
Question: Host-named site collections are always a better choice when compared to multiple web
applications, each with a host header.
( ) True
( ) False
Answer:
( ) True
() False

Customizing User Interface Elements 14-1

Module 14
Customizing User Interface Elements
Contents:
Lesson 1: Working with Custom Actions

Lesson 2: Using Client-Side User Interface Components

Lesson 3: Customizing the SharePoint List User Interface

Module Review and Takeaways

10

14-2 Developing Microsoft SharePoint 2013 Core Solutions

Lesson 1

Working with Custom Actions


Contents:
Resources
Demonstration: Customizing the Ribbon

3
4

Customizing User Interface Elements 14-3

Resources
Using the CustomAction Element
Additional Reading: For more information about the attributes of the CustomAction
element, see CustomAction Element in the MSDN library at
http://go.microsoft.com/fwlink/?LinkID=311868.
Additional Reading: For more information about the CustomActionGroup and
HideCustomAction elements, see Custom Action Definition Schema at
http://go.microsoft.com/fwlink/?LinkID=311869.

Customizing the Ribbon


Additional Reading: For more information about the locations available on the ribbon,
see Default Server Ribbon Customization Locations in the MSDN library at
http://go.microsoft.com/fwlink/?LinkID=311871.
Additional Reading: For more information about the different controls, see the Child
Elements list on the Controls Element page at http://go.microsoft.com/fwlink/?LinkID=311870.
Additional Reading: For more information about the CommandUIHandler element, see
CommandUIHandler Element in the MSDN library at
http://go.microsoft.com/fwlink/?LinkID=311872.
Additional Reading: For a full list of the values that you can use for the RegistrationId
attribute, see SPListTemplateType enumeration in the MSDN library at
http://go.microsoft.com/fwlink/?LinkID=311873.
Additional Reading: For more information about the GroupTemplate element, see
GroupTemplate Element in the MSDN library at http://go.microsoft.com/fwlink/?LinkID=311874.
Additional Reading: For more information about scaling, see Scaling Element in the
MSDN library at http://go.microsoft.com/fwlink/?LinkID=311875.

Demonstration: Customizing the Ribbon


Demonstration Steps
1.

Start the 20488B-LON-SP-14 virtual machine.

2.

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

3.

On the Start screen, click Internet Explorer.

4.

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

5.

On the Quick Launch toolbar, click Documents.

6.

On the ribbon, click LIBRARY.

7.

Review the groups that are present on the ribbon, and then close Internet Explorer.

8.

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

9.

On the FILE menu, point to Open, and then click Project/Solution.

14-4 Developing Microsoft SharePoint 2013 Core Solutions

10. In the Open Project dialog box, browse to the E:\Democode folder, click
RibbonCustomActions.sln, and then click Open.
11. In Solution Explorer, expand Features, and then double-click ContosoCustomActionsFeature.
12. In the Items in the Feature list, point out the ContosoCustomActions element.
13. In Solution Explorer, expand ContosoCustomActions, and then double-click
LibraryCustomActions.xml.
14. Point out the attributes for the CustomAction element.
15. Point out the Location for the first CommandUIDefinition.
16. Point out the attributes for the Group element.
17. Point out the Button elements and their Command attributes, and then point out the matching
Command attributes in the CommandUIHandler elements.
18. Point out the CommandAction attribute for each CommandUIHandler.
19. On the BUILD menu, click Deploy RibbonCustomActions.
20. On the Start screen, click Internet Explorer.
21. In Internet Explorer, in the address bar, type http://team.contoso.com, and then press Enter.
22. On the Quick Launch toolbar, click Documents.
23. On the ribbon, click LIBRARY.
24. Point out the Contoso tab, and the two new buttons.
25. Click the About button, note the Message from webpage popup, and then click OK.
26. Close Internet Explorer, and then close Visual Studio.

Customizing User Interface Elements 14-5

Lesson 2

Using Client-Side User Interface Components


Contents:
Resources
Demonstration: Displaying Status Bar Messages
Demonstration: Displaying Notifications

6
6
6

14-6 Developing Microsoft SharePoint 2013 Core Solutions

Resources
Displaying Callouts
Additional Reading: For more information about the executeFunc method, see
SP.SOD.executeFunc(key, functionName, fn) Method at
http://go.microsoft.com/fwlink/?LinkID=311876.

Demonstration: Displaying Status Bar Messages


Demonstration Steps
1.

Start the 20488B-LON-SP-14 virtual machine.

2.

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

3.

On the Start screen, click Visual Studio 2012.

4.

On the FILE menu, point to Open, and then click Project/Solution.

5.

In the Open Project dialog box, browse to E:\Democode, click StatusBarMessage.sln, and then
click Open.

6.

In Solution Explorer, double-click InformationBar.

7.

Point out that the CommandAction attribute in the CommandUIHandler element contains
JavaScript code to display a status message and change its color.

8.

On the BUILD menu, click Deploy StatusBarMessage.

9.

On the Start screen, click Internet Explorer.

10. In Internet Explorer, in the address bar, type http://team.contoso.com, and then press Enter.
11. On the Quick Launch toolbar, click Documents.
12. On the ribbon, click Library.
13. On the ribbon, in the Share & Track group, click Display Status Message.
14. Point out the yellow information bar.
15. Close Internet Explorer.
16. Close Visual Studio.

Demonstration: Displaying Notifications


Demonstration Steps
1.

Start the 20488B-LON-SP-14 virtual machine.

2.

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

3.

On the Start screen, click Visual Studio 2012.

4.

On the FILE menu, point to Open, and then click Project/Solution.

5.

In the Open Project dialog box, browse to E:\Democode, click Notification.sln, and then click
Open.

6.

In Solution Explorer, double-click Notification.

Customizing User Interface Elements 14-7

7.

Point out that the CommandAction attribute in the CommandUIHandler element contains
JavaScript code to display a notification.

8.

On the BUILD menu, click Deploy Notification.

9.

On the Start screen, click Internet Explorer.

10. In Internet Explorer, in the address bar, type http://team.contoso.com, and then press Enter.
11. On the Quick Launch toolbar, click Documents.
12. On the ribbon, click Library.
13. On the ribbon, in the Share & Track group, click Notification.
14. Point out the notification that appears.
15. Close Internet Explorer.
16. Close Visual Studio.

14-8 Developing Microsoft SharePoint 2013 Core Solutions

Lesson 3

Customizing the SharePoint List User Interface


Contents:
Resources
Demonstration: Applying Conditional Formatting

9
9

Customizing User Interface Elements 14-9

Resources
Using jQuery UI In Client-Side Rendering Code
Additional Reading: For more information about the functionality available in the jQuery
UI library, see jQuery user interface at http://go.microsoft.com/fwlink/?LinkID=311877 (this URL
redirects to a third-party website).

Demonstration: Applying Conditional Formatting


Demonstration Steps
1.

Start the 20488B-LON-SP-14 virtual machine.

2.

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

3.

On the Start screen, click Visual Studio 2012.

4.

On the FILE menu, point to Open, and then click Project/Solution.

5.

In the Open Project dialog box, browse to the E:\Democode folder, click ProgressBarApp.sln, and
then click Open.

6.

In Solution Explorer, expand Custom Tasks, and then double-click Schema.xml.

7.

Locate the View element with the BaseViewID="1" attribute and point out the JSLink child element
that links the JavaScript file to the view.

8.

In this View element, point out the contents of the ViewFields element, which defines which fields to
display in the view.

9.

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

10. In the main function, point out that the PercentComplete field is calling the progressBar function.
11. In the progressBar function, point out that the function performs the following tasks:
1.

It removes the percentage sign from the PercentComplete property and stores it and the DueDate
property in variables.

2.

It passes the variables to the getColor function, which determines whether to display the progress
bar as red or green.

3.

In the getColor function, point out the if block, which determines the color to use.

4.

On the DEBUG menu, click Start Debugging.

5.

In Internet Explorer, point out that the overdue, but unfinished, task displays in red and the current
task displays in green.

6.

Click new item.

7.

On the EDIT page, in the Task Name box, type Write code.

8.

By the Due Date box, click the Calendar icon, click yesterdays date.

9.

Click SHOW MORE, in the % Complete box, type 100, and then click Save.

10. Point out that the task displays in green.


11. Close Internet Explorer and then close Visual Studio.

14-10 Developing Microsoft SharePoint 2013 Core Solutions

Module Review and Takeaways


Review Question(s)
Question: You want to add a custom button to the ribbon in a sandboxed solution, but you cant find the
Ribbon Custom Item in the Add New Item dialog box. What is the problem?
Question: You want to provide the user with additional information about an element in the SharePoint
user interface without interrupting their work. Which functionality should you use?
( ) Status bar message
( ) Notifications
( ) Dialog box
( ) Callouts
Answer:
( ) Status bar message
( ) Notifications
( ) Dialog box
() Callouts
Question: You can only use client-side rendering to customize list views.
( ) True
( ) False
Answer:
( ) True
() False

Working with Branding and Navigation 15-1

Module 15
Working with Branding and Navigation
Contents:
Lesson 1: Creating and Applying Themes

Lesson 2: Branding and Designing Publishing Sites

Lesson 3: Tailoring Content to Platforms and Devices

Module Review and Takeaways

13

15-2 Developing Microsoft SharePoint 2013 Core Solutions

Lesson 1

Creating and Applying Themes


Contents:
Resources
Demonstration: Building a Composed Look

3
3

Working with Branding and Navigation 15-3

Resources
Creating Custom Color Palettes
Reference Links: For more information and to download the SharePoint Color Palette
Tool, see SharePoint Color Palette Tool at http://go.microsoft.com/fwlink/?LinkID=311880.

Deploying Custom Themes


Additional Reading: For more information about deploying theme components, see How
to: Deploy a custom theme in SharePoint 2013 at http://go.microsoft.com/fwlink/?LinkID=311881.
In particular, this topic describes how to update the theme named Current in the Composed
Looks list.

Demonstration: Building a Composed Look


Demonstration Steps
1.

Start the 20488B-LON-SP-15 virtual machine.

2.

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

3.

Open Internet Explorer, and browse to http://team.contoso.com.

4.

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

5.

On the Settings menu, click Change the look.

6.

On the Change the look page, scroll through the available designs. Explain that these are the built-in
composed looks that ship with SharePoint 2013.

7.

Click Nature.

8.

Explain that the preview image is generated by the master page preview file. You can create a
preview file, with a .preview file name extension, for every master page you add to the master page
gallery.

9.

On the left of the page, under Start over, explain that the image is the background image for the
composed look. Administrators can change the background image to an image in a library on the
site, or upload a new image.

10. Under Colors, click the drop-down arrow. Explain that these are the color palettes that are currently
available on the site.
11. Hover over several of the color palettes in the list, and draw attention to how the preview image is
updated accordingly.
12. Click the second color palette from the top.
13. Under Site layout, click the drop-down arrow. Explain that these are the master pages that are
currently available for use with composed looks.
14. Hover over Oslo, draw attention to how the preview image is updated, and then click Seattle.
15. Under Fonts, click the drop-down arrow. Explain that these are the font themes that are currently
available on the site.
16. Click Blueprint MT Pro, and draw attention to how the preview image is updated.

15-4 Developing Microsoft SharePoint 2013 Core Solutions

17. At the upper-right corner of the page, click Try it out.


18. On the preview page, click No, not quite there.
19. On the Fonts drop-down menu, click Century Gothic, and then click Try it out.
20. On the preview page, click Yes, keep it.
21. On the Site Settings page, click the site logo to return to the home page.
22. Point out how the new composed look is applied to every aspect of the home page.
23. On the Settings menu, click Site settings.
24. Under Web Designer Galleries, click Composed looks.
25. On the Composed Looks page, click new item.
26. Point out how you can create a composed look manually by specifying a master page URL, a theme
(color palette) URL, a background image URL, and a font scheme URL.
27. Close Internet Explorer.

Working with Branding and Navigation 15-5

Lesson 2

Branding and Designing Publishing Sites


Contents:
Resources
Demonstration: Developing Master Pages with Design Manager
Demonstration: Developing Page Layouts with Design Manager

6
6
7

15-6 Developing Microsoft SharePoint 2013 Core Solutions

Resources
Creating Master Pages
Additional Reading: For more information about creating master pages, see How to:
Convert an HTML file into a master page in SharePoint 2013 at
http://go.microsoft.com/fwlink/?LinkID=311882.

Creating Page Layouts


Additional Reading: For more information about creating page layouts, see How to:
Create a page layout in SharePoint 2013 at http://go.microsoft.com/fwlink/?LinkID=311883.

Demonstration: Developing Master Pages with Design Manager


Demonstration Steps
1.

Connect to the 20488B-LON-SP-15 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, right-click Computer, and then click Map network drive.

4.

In the Map Network Drive dialog box, in the Folder box, type
http://publishing.contoso.com/_catalogs/masterpage, and then click Finish.

5.

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

6.

When the File Explorer window displays the contents of the master page gallery, close the window.

7.

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

8.

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

9.

In the New File dialog box, click HTML Page, and then click Open.

10. On the blank line after the opening body element, add the following markup:
<p>ThisisaverysimpleHTMLfile.</p>

11. On the FILE menu, click Save HTMLPage1.html As.


12. In the Save File As dialog box, under Computer, click masterpage.
13. In the File name box, type Contoso.html, and then click Save.
14. Close Visual Studio.
15. On the Start screen, click Internet Explorer, and browse to http://publishing.contoso.com.
16. If you are prompted for credentials, log on as CONTOSO\Administrator with the password
Pa$$w0rd.
17. When the page loads, on the Settings menu, click Design Manager.
18. On the list on the left side of the page, click Edit Master Pages.

Working with Branding and Navigation 15-7

19. On the Design Manager: Edit Master Pages page, click Convert an HTML file to a SharePoint
master page.
20. In the Select an Asset dialog box, click Contoso.html, and then click Insert.
21. On the list on the left side of the page, click Edit Master Pages again to refresh the list of pages.
22. Without closing Internet Explorer, open a File Explorer window, and then click masterpage.
23. Point out that the master page gallery now includes a file named Contoso.master in addition to the
Contoso.html file.
24. Right-click Contoso.html, point to Open with, and then click Microsoft Visual Studio 2012.
25. Review the content that SharePoint has added to the Contoso.html file, paying particular attention to
the ContentPlaceHolderMain div toward the end of the file.
26. Switch back to Internet Explorer.
27. On the Design Manager: Edit Master pages page, click Contoso.
28. On the master page preview, point out that the ribbon and the welcome menu are included on the
page.
29. At the top of the page, click Snippets.
30. On the ribbon, in the Navigation group, click Search Box.
31. On the right side of the page, briefly explore the options for customizing the search box.
32. On the left side of the page, under the HTML Snippet box, click Copy to Clipboard.
33. If the Internet Explorer dialog box appears, click Allow access.
34. Switch back to Visual Studio.
35. Add a new line immediately above the DefaultContentBlock div element, and then press Ctrl+V to
paste the markup for a search box.
36. On the FILE menu, click Save All, and then switch back to Internet Explorer.
37. In Internet Explorer, on the master page preview page, click Refresh.
38. Point out that the search box has been added to the page. Explain that you should use CSS to
position the search box div where you want it to appear on the page.
39. Close Internet Explorer, File Explorer and Visual Studio.

Demonstration: Developing Page Layouts with Design Manager


Demonstration Steps
1.

Connect to the 20488B-LON-SP-15 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.

On the Start screen, click Internet Explorer, and browse to http://publishing.contoso.com.

4.

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

5.

On the Settings menu, click Design Manager.

6.

On the list on the left side of the page, click Edit Page Layouts.

7.

On the Design Manager: Edit Page Layouts page, click Create a page layout.

15-8 Developing Microsoft SharePoint 2013 Core Solutions

8.

In the Create a Page Layout dialog box, in the Name box, type FactSheet.

9.

In the Master Page list, click seattle.

10. In the Content Type list, click Article Page, and then click OK.
11. Without closing Internet Explorer, open a File Explorer window and click masterpage.
12. In the File Explorer window, point out that SharePoint has created files named FactSheet.aspx and
FactSheet.html.
13. Right-click FactSheet.html, point to Open with, and then click Microsoft Visual Studio 2012.
14. Briefly review the HTML content that SharePoint has generated for the page layout. Point out the
commented out asp:ContentPlaceHolder elements, which represent the content placeholders in the
master page. You add all markup for the page layout within these elements.
15. Toward the end of the file, draw attention to how SharePoint has created a div element for each field
control. Explain that you can edit the HTML and add CSS files to control how the field controls are
presented.
16. Close Visual Studio, File Explorer, and then Internet Explorer.

Working with Branding and Navigation 15-9

Lesson 3

Tailoring Content to Platforms and Devices


Contents:
Resources
Demonstration: Creating and Configuring a Device Channel
Demonstration: Creating and Configuring an Image Rendition

10
10
11

15-10 Developing Microsoft SharePoint 2013 Core Solutions

Resources
Understanding Device Channels
Additional Reading: For a more detailed analysis of user-agent strings, see
Understanding user-agent strings at http://go.microsoft.com/fwlink/?LinkID=311884.
Additional Reading: For more information about device channels, see SharePoint 2013
Design Manager device channels at http://go.microsoft.com/fwlink/?LinkID=311885.

Understanding Image Renditions


Reference Links: For guidance on how to enable and configure the BLOB cache, see
Configure cache settings for a web application in SharePoint Server 2013 at
http://go.microsoft.com/fwlink/?LinkID=311886.

Demonstration: Creating and Configuring a Device Channel


Demonstration Steps
1.

Connect to the 20488B-LON-SP-15 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 Internet Explorer and browse to http://publishing.contoso.com.

4.

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

5.

On the Settings menu, click Design Manager.

6.

On the list on the left side of the page, click 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 Devices.

9.

In the Alias box, type WindowsPhoneGeneric.

Note: Explain that the alias is used to reference the device channel in various scenarios,
such as when you create device channel panels.
10. In the Description box, type A device channel for all Windows Phone devices.
11. In the Device Inclusion Rules box, type Windows Phone OS.
12. Select Active, and then click Save.
13. On the list on the left side of the page, click Publish and Apply Design.
14. On the Design Manager: Publish and Apply Design page, click Assign master pages to your site
based on device channel.
15. In the Site Master Page Settings dialog box, in the Site Master Page section, in the Windows
Phone Devices drop-down menu, click oslo, and then click OK.
16. On the top navigation menu, click Contoso Publishing to return to the site home page.

Working with Branding and Navigation 15-11

17. Append ?DeviceChannel=WindowsPhoneGeneric to the page URL, and then press Enter.
Note: Explain that the DeviceChannel query string provides a way of testing device channels.
When you specify a DeviceChannel query string, the device channel is applied regardless of device
inclusion rules.
18. Point out that the page reloads using the alternative master page.

Demonstration: Creating and Configuring an Image Rendition


Demonstration Steps
1.

Connect to the 20488B-LON-SP-15 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.

5.

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

6.

Provide a brief explanation of the BlobCache element attributes:


a.

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

b.

The path attribute specifies the file types that should be cached, in the form of a regular
expression.

c.

The maxSize attribute specifies the maximum size of the cache in gigabytes (GB).

d.

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://publishing.contoso.com.

9.

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

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 left side of the page, click Site Contents.
17. On the Site Contents page, click Site Collection Images.
18. On the Site Collection Images page, click new item.

15-12 Developing Microsoft SharePoint 2013 Core Solutions

19. In the Add a document dialog box, browse to E:\Democode\VanGogh-starry_night.jpg, click


Open, and then click OK.
20. In the Site Collection Images VanGogh-starry_night.jpg dialog box click Save.
21. On the Site Collection Images page, click All Assets.
22. On the All Assets page, select the VanGogh-starry_night 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. Click OK in the Message from Webpage dialog box.
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.
28. Drag the selected area around, and notice how the preview image is updated.
Note: The learning 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.

Working with Branding and Navigation 15-13

Module Review and Takeaways


Review Question(s)
Question: Which of the following items do you not deploy in a composed look?
( ) A master page.
( ) A color palette.
( ) A font scheme.
( ) A background image.
( ) A CSS file.
Answer:
( ) A master page.
( ) A color palette.
( ) A font scheme.
( ) A background image.
() A CSS file.
Question: You want to create a new page layout. What should you do first?
( ) Create a new master page in Design Manager.
( ) Create or identify a page layout content type.
( ) Create custom field controls.
( ) Create a new page layout in Design Manager.
( ) Create a new page layout in HTML.
Answer:
( ) Create a new master page in Design Manager.
() Create or identify a page layout content type.
( ) Create custom field controls.
( ) Create a new page layout in Design Manager.
( ) Create a new page layout in HTML.
Question: True or false: Image renditions are defined independently on each individual image on a site
collection.
( ) True
( ) False
Answer:
( ) True
() False

15-14 Developing Microsoft SharePoint 2013 Core Solutions

Question: Which of the following navigation providers supplies site map nodes for the local part of the
breadcrumb trail in SharePoint sites?
( ) SPSiteMapProvider
( ) SPContentMapProvider
( ) SPXmlContentMapProvider
( ) SPNavigationProvider
( ) PortalSiteMapProvider
Answer:
( ) SPSiteMapProvider
() SPContentMapProvider
( ) SPXmlContentMapProvider
( ) SPNavigationProvider
( ) PortalSiteMapProvider

You might also like