20488B ENU Companion
20488B ENU Companion
20488B ENU Companion
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
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
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.
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.
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,
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,
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.
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
Module 1
SharePoint as a Developer Platform
Contents:
Lesson 1: Introducing the SharePoint Developer Landscape
Lesson 1
3
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.
2.
3.
On the Start screen, type Visual Studio 2012, and then click Visual Studio 2012.
4.
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.
8.
9.
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.
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.
Lesson 3
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.
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.
Module 2
Working with SharePoint Objects
Contents:
Lesson 2: Working with Sites and Webs
Lesson 2
5
5
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.
2.
3.
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.
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();
Lesson 3
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.
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.
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.
Module 3
Working with Lists and Libraries
Contents:
Lesson 1: Using List and Library Objects
11
Lesson 1
2.
3.
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.
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.
9.
In the OnPreRender method, locate the comment that reads Populate the rblPriority radio button
list.
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.
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.
Lesson 2
6
7
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.
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.
5.
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
Note: Take care not to edit or delete any of the existing values in the Path variable.
8.
9.
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");
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.
Lesson 3
10
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.
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
Module 4
Designing and Managing Features and Solutions
Contents:
Lesson 1: Understanding Features and Solutions
10
12
Lesson 1
3
3
4
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.
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.
4.
Explain that the Features within this folder are one of the following:
a.
Built-in Features
b.
c.
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.
b.
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.
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.
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.
4.
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.
8.
9.
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.
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.
Lesson 2
7
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.
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
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.
7.
8.
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.
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.
Lesson 3
10
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.
Module 5
Working with Server-Side Code
Contents:
Lesson 1: Developing Web Parts
11
Lesson 1
2.
3.
4.
5.
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.
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.
Lesson 2
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.
Lesson 3
7
7
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.
2.
3.
On the Start screen, type Central Administration, and then press Enter.
4.
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.
8.
On the Edit Timer Job page, point out the recurring schedule, and the Run Now button.
9.
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.
Lesson 4
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.
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.
Module 6
Managing Identity and Permissions
Contents:
Lesson 1: Understanding Identity Management in SharePoint 2013
11
12
Lesson 1
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.
Troubleshooting Tip
Lesson 2
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.
Lesson 3
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.
Lesson 4
10
10
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.
2.
3.
4.
5.
Double-click ContosoClaimsProvider.sln.
6.
7.
8.
Right-click the located code, click Breakpoint, and then click Insert breakpoint.
9.
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.
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
Module 7
Introducing Apps for SharePoint
Contents:
Lesson 1: Overview of Apps for SharePoint
Lesson 1
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.
Lesson 2
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.
2.
3.
4.
In Visual Studio, click File, click New, and then click Project.
5.
6.
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.
21. In the Default.aspx code window, locate the following line of code:
PageTitle
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.
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.
Module 8
Client-Side SharePoint Development
Contents:
Lesson 2: Using the Client-Side Object Model for JavaScript
Lesson 2
2.
3.
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.
8.
9.
16. Place the cursor within the anonymous function you just created.
17. Type the following code:
varenumerator=items.getEnumerator();
20. Place the cursor within the while loop you just created.
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"));
Troubleshooting Tip
If you do not include the form digest in
your REST request headers, SharePoint will
deny your request to prevent malicious
attacks.
Module 9
Developing Remote-hosted Apps for SharePoint
Contents:
Lesson 2: Configuring Remote-Hosted Apps
Lesson 2
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.
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
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
Module 10
Publishing and Distributing Apps
Contents:
Lesson 2: Understanding App Packages
Lesson 2
2.
3.
4.
5.
Select the file name extension .app, type .zip, and then press Enter.
6.
7.
8.
9.
Double-click AppIcon.png.
Note: Windows Photo Viewer displays the app icon file.
Lesson 3
Publishing Apps
Contents:
Resources
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.
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
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
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 1
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.
Lesson 2
5
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.
2.
3.
On the Start screen, type SharePoint Designer 2013, and then click SharePoint Designer 2013.
4.
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.
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.
Lesson 3
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.
Module 12
Managing Taxonomy
Contents:
Lesson 1: Managing Taxonomy in SharePoint 2013
Lesson 1
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.
Lesson 2
2.
3.
On the Start screen, type Visual Studio, and then click Visual Studio 2012.
4.
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.
7.
8.
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.
Required="TRUE"
Group="Contoso Columns">
</Field>
Format="DateOnly"
Required="TRUE"
Group="Contoso Columns">
</Field>
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>
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.
Module 13
Managing Custom Components and Site Life Cycles
Contents:
Lesson 1: Defining Custom Lists
Lesson 1
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.
Lesson 2
5
6
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.
2.
3.
4.
5.
6.
Double-click WEBTEMP.xml
7.
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.
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.
Lesson 3
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.
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
Module 14
Customizing User Interface Elements
Contents:
Lesson 1: Working with Custom Actions
10
Lesson 1
3
4
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.
2.
3.
4.
In Internet Explorer, in the address bar, type http://team.contoso.com, and then press Enter.
5.
6.
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.
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.
Lesson 2
6
6
6
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.
2.
3.
4.
5.
In the Open Project dialog box, browse to E:\Democode, click StatusBarMessage.sln, and then
click Open.
6.
7.
Point out that the CommandAction attribute in the CommandUIHandler element contains
JavaScript code to display a status message and change its color.
8.
9.
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.
2.
3.
4.
5.
In the Open Project dialog box, browse to E:\Democode, click Notification.sln, and then click
Open.
6.
7.
Point out that the CommandAction attribute in the CommandUIHandler element contains
JavaScript code to display a notification.
8.
9.
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.
Lesson 3
9
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).
2.
3.
4.
5.
In the Open Project dialog box, browse to the E:\Democode folder, click ProgressBarApp.sln, and
then click Open.
6.
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.
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.
5.
In Internet Explorer, point out that the overdue, but unfinished, task displays in red and the current
task displays in green.
6.
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.
Module 15
Working with Branding and Navigation
Contents:
Lesson 1: Creating and Applying Themes
13
Lesson 1
3
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.
2.
3.
4.
If you are prompted for credentials, log on as CONTOSO\Administrator with the password
Pa$$w0rd.
5.
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.
Lesson 2
6
6
7
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.
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.
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>
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.
2.
If you are not already logged on, log on to the LONDON machine as CONTOSO\Administrator with
the password Pa$$w0rd.
3.
4.
If you are prompted for credentials, log on as CONTOSO\Administrator with the password
Pa$$w0rd.
5.
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.
8.
In the Create a Page Layout dialog box, in the Name box, type FactSheet.
9.
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.
Lesson 3
10
10
11
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.
2.
If you are not already logged on, log on to the LONDON machine as CONTOSO\Administrator with
the password Pa$$w0rd.
3.
4.
If you are prompted for credentials, log on as CONTOSO\Administrator with the password
Pa$$w0rd.
5.
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.
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.
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.
2.
If you are not already logged on, log on to the LONDON machine as CONTOSO\Administrator with
the password Pa$$w0rd.
3.
4.
Right-click web.config, point to Open with, and then click Microsoft Visual Studio 2012.
5.
6.
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.
Note: The BLOB cache is already enabled in the virtual machine to save time during the
demonstration.
7.
8.
9.
If you are prompted for credentials, log on as CONTOSO\Administrator with the password
Pa$$w0rd.
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