SlideShare a Scribd company logo
1 of 34
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 1
Jay Landrum
Co-Founder, Almond Labs
@AlmondLabs
Almond Labs Identity Service Application
Simple external authentication for on premise SharePoint
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 2
Pranav Sharma Eugene Wilson Hector Ramos
Almond Labs
ā€œWorking to create products and solutions that improve
user adoption, engagement and productivity with
SharePoint.ā€
Intro to Client Side
Solutions in
SharePoint 2013
ALMOND LABS
SATURDAY SEPTEMBER 21, 2013
+1 (866) 773-9175 | SALES@ALMONDLABS.COM 310/7/2013
Customizing SharePoint
ā€¢ SharePoint 2007 ā€“ Server side code
ā€¢ SharePoint 2010 - Client side object model
ā€¢ CSOM built to support Silverlight but not complete
ā€¢ SharePoint 2013 - Prioritizes client side
development
ā€¢ App model
ā€¢ Office 365 and hosted SharePoint environments
ā€¢ Search display templates
ā€¢ List views
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 4
Why client side solutions?
ā€¢ Fast prototyping and development
ā€¢ Low impact deployment and updates
ā€¢ No more recycled app pools!
ā€¢ No downtime!
ā€¢ No need to access the server
ā€¢ Errors can be identified through the browser
ā€¢ Allows significant customizations with just
SharePoint designer
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 5
Required learning
ā€¢ JavaScript
ā€¢ jQuery
ā€¢ Knockout
ā€¢ JSON
ā€¢ SharePoint REST Services
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 6
Javaā€¦ script?
Pros
ā€¢ Client side code (runs in the browser, not on the server)
ā€¢ Easy deployment enables quick, iterative development
ā€¢ Dynamic typing and magic!
Cons
ā€¢ Development and cross browser support can be
cumbersome
ā€¢ Getting at back-end data can be difficult
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 7
jQuery
Built on top of JavaScript, jQuery
provides a verb oriented framework
that simplifies almost every aspect of
client side development.
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 8
jQuery
Pros
ā€¢ Simplifies and enables very quick client side development
ā€¢ Solves the problem of cross browser support
ā€¢ Numerous plugins exist to enhance the functionality
ā€¢ Formally adopted by Microsoft
Cons
ā€¢ Constantly being supported/updated so you wonā€™t have the
latest version for very long
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 9
Without jQuery
if (!document.getElementsByClassName) {
document.getElementsByClassName = function (cn) {
var allT = document.getElementsByTagName('*'), allCN = [], i = 0, a;
while (a = allT[i++]) {
a.className == cn ? allCN[allCN.length] = a : null;
}
return allCN;
}
}
var flyouts = document.getElementsByClassName("Flyout");
for (var x = 0; x < flyouts.length; x++) {
flyouts[0].styles.display = "none";
}
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 10
With jQuery
$(".Flyout").hide();
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 11
Knockout.js
Knockout provides a complete solution
for using MVVM practices in client side
development, including two way data-
binding and easy extensibility.
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 12
Knockout.js
Pros
ā€¢ Solves the problem of creating dynamic, data-driven UIā€™s on the client
side
ā€¢ Does not depend on jQuery or other libraries
ā€¢ Very complete and well documented
ā€¢ Almost forces good development practices
ā€¢ Adopted by Microsoft
ā€¢ Backwards compatible to IE6
Cons
ā€¢ Does not integrate with jQuery
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 13
Without Knockout.js
<div id="Container"></div>
<script type="text/javascript">
var data = [ā€¦];
var ul = document.createElement("ul");
for (var x = 0; x < data.length; x++) {
var li = document.createElement("li");
li.innerHTML = data[x].Name;
ul.appendChild(li);
}
document.getElementById("Container").appendChild(ul);
</script>
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 14
With Knockout.js
<div>
<ul data-bind="foreach: Data">
<li data-bind="text: Name"></li>
</ul>
</div>
<script type="text/javascript">
function ViewModel() {
var self = this;
self.Data = [ā€¦];
}
ko.applyBindings(new ViewModel());
</script>
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 15
JSON
ā€¢ Most simply, a way of representing data
ā€¢ Lightweight and designed to be readable
ā€¢ Becoming the standard of how data is
passed on the web
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 16
JavaScript Object Notation
ā€¢ Single record (object)
{
Name: "SharePoint User Group Baltimore",
Description: "Our mission is to bring the..."
}
ā€¢ Collection of records (array of objects)
[
{
Name: "SharePoint User Group Baltimore",
Description: "Our mission is to bring the..."
},
{
Name: "SharePoint User Group DC",
Description: "A year-round resource..."
}
]
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 17
Demo
Knockout.js
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 18
REST-ful web APIs
ā€¢ REST web APIā€™s provide a technology agnostic method of
interacting with data.
ā€¢ Generally, API endpoints support Create, Read, Update, and
Delete operations (GET, POST, PUT, DELETE)
ā€¢ Generally defined by readable Urls
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 19
REST Example
Google Search
https://www.google.com/search?q=SharePoint Saturday New Jersey
Google Search API
http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=ShareP
oint Saturday New Jersey
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 20
SharePoint 2013 REST API
All REST endpoints exist under /_api/
(aka /_vti_bin/client.svc)
Some highlights are:
ā€¢ Retrieving/updating the state of a site, sub site
or list
ā€¢ Retrieving/updating data from a list or
document library
ā€¢ Running search queries
ā€¢ Read the current userā€™s social feed
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 21
Tips for the SharePoint API
ā€¢ Operates similarly to the existing CSOM
ā€¢ Deferred loading of collections or complex types
ā€¢ ?expand=<field> query string parameter expands deferred types
ā€¢ Collections
ā€¢ For list data, lookup and choice values
ā€¢ $filter=<query> QS parameter is used to filter returned data
ā€¢ $select=<fields> QS parameter is used to limit the returned fields
ā€¢ If possible, use a more specific API endpoint
ā€¢ Use: /_api/lists(guidā€™<Guid>ā€™)/Fields
ā€¢ Instead of: /_api/lists(guidā€™<Guid>ā€™)?expand=Fields
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 22
Demo
SharePoint search tasks rollup
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 23
SharePoint Customizations
ā€¢ Search
ā€¢ Display templates
ā€¢ Supports customizing specific types of search results
ā€¢ Common customization: enabling PDF hover panel previews
ā€¢ List Views
ā€¢ JSLink property
ā€¢ Supports customizing entire list views or individual field rendering
ā€¢ Common customization: creating a simple KPI
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 24
The Best Part
Display templates and customized list views can be
applied through configuration.
List Views
ā€¢ List View Web Part
Display Templates
ā€¢ Content Search Web Part
ā€¢ Search Configuration
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 25
JSLink to Customize List
Views
ā€¢ Configuration point to register a custom
JavaScript file designed to override the
default behavior of a list, list view or
individual field
ā€¢ JSLink can be configured
ā€¢ Through schema (deployed as a feature)
ā€¢ Through the List View Web Part properties
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 26
Demo
ā€¢ Task List KPI
ā€¢ Associated Document Upload
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 27
Search Display Templates
ā€¢ Configuration point to register a custom
template file (built in JavaScript) to change
the display of search results
ā€¢ Configured through
ā€¢ Search Settings
ā€¢ Content Search Web Part
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 28
Demo
Interactive Search Ratings
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 29
Summary
ā€¢ SharePoint 2013 prioritizes client side
development
ā€¢ With JavaScript, jQuery and Knockout, itā€™s easy to
develop and deploy customizations
ā€¢ The 2013 REST API makes it easy to interact with
SharePoint data from client code
ā€¢ Blog post: http://almondlabs.com/blog/intro-to-
client-side-solutions/
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 30
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 31
References
ā€¢ SharePoint 2013 REST Services: http://msdn.microsoft.com/en-us/library/fp142385.aspx,
http://msdn.microsoft.com/en-us/library/jj860569.aspx and
http://msdn.microsoft.com/en-us/library/jj164022.aspx
ā€¢ SharePoint 2013 Search REST API
http://blogs.msdn.com/b/nadeemis/archive/2012/08/24/sharepoint-2013-search-rest-
api.aspx
ā€¢SharePoint 2013 Rest API http://platinumdogs.me/2013/03/14/sharepoint-adventures-
with-the-rest-api-part-1/
ā€¢ Search keyword query syntax: http://msdn.microsoft.com/en-us/library/ee558911.aspx
ā€¢ Search Display Templates: http://msdn.microsoft.com/en-us/library/jj945138.aspx
ā€¢ JSLink feld rendering: http://www.lestersconyers.com/custom-field-rendering-with-jslink/
ā€¢ JSLink Primer: http://www.idubbs.com/blog/2012/js-link-for-sharepoint-2013-web-
partsa-quick-functional-primer/
ā€¢ Knockout.js http://knockoutjs.com/
ā€¢ jQuery http://jquery.com/
10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 32
PRINCETON SHAREPOINT USER GROUP
ā€¢ Different SharePoint discussions each
month on various topics. Announced on
meetup.com
ā€¢ Meets 4th Wednesday of every month
ā€¢ 6pm ā€“ 8pm
ā€¢ Infragistics Office
ā€¢ 2 Commerce Drive, Cranbury, NJ
ā€¢ http://www.meetup.com/princetonSUG
ā€¢ http://www.princetonsug.com
Intro to Client Side Solutions in SharePoint 2013

More Related Content

More from SharePoint Saturday New Jersey

More from SharePoint Saturday New Jersey (12)

A Beginner's Guide to Client Side Development with Javascript
A Beginner's Guide to Client Side Development with JavascriptA Beginner's Guide to Client Side Development with Javascript
A Beginner's Guide to Client Side Development with Javascript
Ā 
Where to save my data, for devs!
Where to save my data, for devs!Where to save my data, for devs!
Where to save my data, for devs!
Ā 
SharePoint Saturday NJ 2014 Slides
SharePoint Saturday NJ 2014 SlidesSharePoint Saturday NJ 2014 Slides
SharePoint Saturday NJ 2014 Slides
Ā 
Improving the SharePoint Development Process with Continuous Integration
Improving the SharePoint Development Process with Continuous IntegrationImproving the SharePoint Development Process with Continuous Integration
Improving the SharePoint Development Process with Continuous Integration
Ā 
10 points to make a rogue SharePoint environment really, really secure..
10 points to make a rogue SharePoint environment really, really secure..10 points to make a rogue SharePoint environment really, really secure..
10 points to make a rogue SharePoint environment really, really secure..
Ā 
Insights and Monitoring of SharePoint Applications
Insights and Monitoring of SharePoint ApplicationsInsights and Monitoring of SharePoint Applications
Insights and Monitoring of SharePoint Applications
Ā 
Optimizing SQL Server 2012 for SharePoint 2013
Optimizing SQL Server 2012 for SharePoint 2013Optimizing SQL Server 2012 for SharePoint 2013
Optimizing SQL Server 2012 for SharePoint 2013
Ā 
Integrating Office Web Apps with SharePoint 2013
Integrating Office Web Apps with SharePoint 2013Integrating Office Web Apps with SharePoint 2013
Integrating Office Web Apps with SharePoint 2013
Ā 
Anatomy of a mail app
Anatomy of a mail appAnatomy of a mail app
Anatomy of a mail app
Ā 
Exchange Server 2013 and SharePoint Server 2013 Integration
Exchange Server 2013 and SharePoint Server 2013 IntegrationExchange Server 2013 and SharePoint Server 2013 Integration
Exchange Server 2013 and SharePoint Server 2013 Integration
Ā 
Term Store Navigation
Term Store NavigationTerm Store Navigation
Term Store Navigation
Ā 
Business Intelligence
Business IntelligenceBusiness Intelligence
Business Intelligence
Ā 

Recently uploaded

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
Ā 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
Ā 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
Ā 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜RTylerCroy
Ā 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
Ā 
WhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
Ā 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
Ā 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
Ā 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024The Digital Insurer
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
Ā 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
Ā 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
Ā 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
Ā 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
Ā 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
Ā 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
Ā 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Ā 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Ā 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
Ā 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜
Ā 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
Ā 
WhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure service
Ā 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Ā 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Ā 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Ā 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024
Ā 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
Ā 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
Ā 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
Ā 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Ā 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
Ā 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
Ā 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
Ā 

Intro to Client Side Solutions in SharePoint 2013

  • 1. 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 1 Jay Landrum Co-Founder, Almond Labs @AlmondLabs Almond Labs Identity Service Application Simple external authentication for on premise SharePoint
  • 2. 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 2 Pranav Sharma Eugene Wilson Hector Ramos Almond Labs ā€œWorking to create products and solutions that improve user adoption, engagement and productivity with SharePoint.ā€
  • 3. Intro to Client Side Solutions in SharePoint 2013 ALMOND LABS SATURDAY SEPTEMBER 21, 2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 310/7/2013
  • 4. Customizing SharePoint ā€¢ SharePoint 2007 ā€“ Server side code ā€¢ SharePoint 2010 - Client side object model ā€¢ CSOM built to support Silverlight but not complete ā€¢ SharePoint 2013 - Prioritizes client side development ā€¢ App model ā€¢ Office 365 and hosted SharePoint environments ā€¢ Search display templates ā€¢ List views 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 4
  • 5. Why client side solutions? ā€¢ Fast prototyping and development ā€¢ Low impact deployment and updates ā€¢ No more recycled app pools! ā€¢ No downtime! ā€¢ No need to access the server ā€¢ Errors can be identified through the browser ā€¢ Allows significant customizations with just SharePoint designer 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 5
  • 6. Required learning ā€¢ JavaScript ā€¢ jQuery ā€¢ Knockout ā€¢ JSON ā€¢ SharePoint REST Services 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 6
  • 7. Javaā€¦ script? Pros ā€¢ Client side code (runs in the browser, not on the server) ā€¢ Easy deployment enables quick, iterative development ā€¢ Dynamic typing and magic! Cons ā€¢ Development and cross browser support can be cumbersome ā€¢ Getting at back-end data can be difficult 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 7
  • 8. jQuery Built on top of JavaScript, jQuery provides a verb oriented framework that simplifies almost every aspect of client side development. 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 8
  • 9. jQuery Pros ā€¢ Simplifies and enables very quick client side development ā€¢ Solves the problem of cross browser support ā€¢ Numerous plugins exist to enhance the functionality ā€¢ Formally adopted by Microsoft Cons ā€¢ Constantly being supported/updated so you wonā€™t have the latest version for very long 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 9
  • 10. Without jQuery if (!document.getElementsByClassName) { document.getElementsByClassName = function (cn) { var allT = document.getElementsByTagName('*'), allCN = [], i = 0, a; while (a = allT[i++]) { a.className == cn ? allCN[allCN.length] = a : null; } return allCN; } } var flyouts = document.getElementsByClassName("Flyout"); for (var x = 0; x < flyouts.length; x++) { flyouts[0].styles.display = "none"; } 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 10
  • 11. With jQuery $(".Flyout").hide(); 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 11
  • 12. Knockout.js Knockout provides a complete solution for using MVVM practices in client side development, including two way data- binding and easy extensibility. 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 12
  • 13. Knockout.js Pros ā€¢ Solves the problem of creating dynamic, data-driven UIā€™s on the client side ā€¢ Does not depend on jQuery or other libraries ā€¢ Very complete and well documented ā€¢ Almost forces good development practices ā€¢ Adopted by Microsoft ā€¢ Backwards compatible to IE6 Cons ā€¢ Does not integrate with jQuery 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 13
  • 14. Without Knockout.js <div id="Container"></div> <script type="text/javascript"> var data = [ā€¦]; var ul = document.createElement("ul"); for (var x = 0; x < data.length; x++) { var li = document.createElement("li"); li.innerHTML = data[x].Name; ul.appendChild(li); } document.getElementById("Container").appendChild(ul); </script> 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 14
  • 15. With Knockout.js <div> <ul data-bind="foreach: Data"> <li data-bind="text: Name"></li> </ul> </div> <script type="text/javascript"> function ViewModel() { var self = this; self.Data = [ā€¦]; } ko.applyBindings(new ViewModel()); </script> 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 15
  • 16. JSON ā€¢ Most simply, a way of representing data ā€¢ Lightweight and designed to be readable ā€¢ Becoming the standard of how data is passed on the web 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 16
  • 17. JavaScript Object Notation ā€¢ Single record (object) { Name: "SharePoint User Group Baltimore", Description: "Our mission is to bring the..." } ā€¢ Collection of records (array of objects) [ { Name: "SharePoint User Group Baltimore", Description: "Our mission is to bring the..." }, { Name: "SharePoint User Group DC", Description: "A year-round resource..." } ] 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 17
  • 18. Demo Knockout.js 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 18
  • 19. REST-ful web APIs ā€¢ REST web APIā€™s provide a technology agnostic method of interacting with data. ā€¢ Generally, API endpoints support Create, Read, Update, and Delete operations (GET, POST, PUT, DELETE) ā€¢ Generally defined by readable Urls 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 19
  • 20. REST Example Google Search https://www.google.com/search?q=SharePoint Saturday New Jersey Google Search API http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=ShareP oint Saturday New Jersey 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 20
  • 21. SharePoint 2013 REST API All REST endpoints exist under /_api/ (aka /_vti_bin/client.svc) Some highlights are: ā€¢ Retrieving/updating the state of a site, sub site or list ā€¢ Retrieving/updating data from a list or document library ā€¢ Running search queries ā€¢ Read the current userā€™s social feed 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 21
  • 22. Tips for the SharePoint API ā€¢ Operates similarly to the existing CSOM ā€¢ Deferred loading of collections or complex types ā€¢ ?expand=<field> query string parameter expands deferred types ā€¢ Collections ā€¢ For list data, lookup and choice values ā€¢ $filter=<query> QS parameter is used to filter returned data ā€¢ $select=<fields> QS parameter is used to limit the returned fields ā€¢ If possible, use a more specific API endpoint ā€¢ Use: /_api/lists(guidā€™<Guid>ā€™)/Fields ā€¢ Instead of: /_api/lists(guidā€™<Guid>ā€™)?expand=Fields 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 22
  • 23. Demo SharePoint search tasks rollup 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 23
  • 24. SharePoint Customizations ā€¢ Search ā€¢ Display templates ā€¢ Supports customizing specific types of search results ā€¢ Common customization: enabling PDF hover panel previews ā€¢ List Views ā€¢ JSLink property ā€¢ Supports customizing entire list views or individual field rendering ā€¢ Common customization: creating a simple KPI 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 24
  • 25. The Best Part Display templates and customized list views can be applied through configuration. List Views ā€¢ List View Web Part Display Templates ā€¢ Content Search Web Part ā€¢ Search Configuration 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 25
  • 26. JSLink to Customize List Views ā€¢ Configuration point to register a custom JavaScript file designed to override the default behavior of a list, list view or individual field ā€¢ JSLink can be configured ā€¢ Through schema (deployed as a feature) ā€¢ Through the List View Web Part properties 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 26
  • 27. Demo ā€¢ Task List KPI ā€¢ Associated Document Upload 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 27
  • 28. Search Display Templates ā€¢ Configuration point to register a custom template file (built in JavaScript) to change the display of search results ā€¢ Configured through ā€¢ Search Settings ā€¢ Content Search Web Part 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 28
  • 29. Demo Interactive Search Ratings 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 29
  • 30. Summary ā€¢ SharePoint 2013 prioritizes client side development ā€¢ With JavaScript, jQuery and Knockout, itā€™s easy to develop and deploy customizations ā€¢ The 2013 REST API makes it easy to interact with SharePoint data from client code ā€¢ Blog post: http://almondlabs.com/blog/intro-to- client-side-solutions/ 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 30
  • 31. 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 31
  • 32. References ā€¢ SharePoint 2013 REST Services: http://msdn.microsoft.com/en-us/library/fp142385.aspx, http://msdn.microsoft.com/en-us/library/jj860569.aspx and http://msdn.microsoft.com/en-us/library/jj164022.aspx ā€¢ SharePoint 2013 Search REST API http://blogs.msdn.com/b/nadeemis/archive/2012/08/24/sharepoint-2013-search-rest- api.aspx ā€¢SharePoint 2013 Rest API http://platinumdogs.me/2013/03/14/sharepoint-adventures- with-the-rest-api-part-1/ ā€¢ Search keyword query syntax: http://msdn.microsoft.com/en-us/library/ee558911.aspx ā€¢ Search Display Templates: http://msdn.microsoft.com/en-us/library/jj945138.aspx ā€¢ JSLink feld rendering: http://www.lestersconyers.com/custom-field-rendering-with-jslink/ ā€¢ JSLink Primer: http://www.idubbs.com/blog/2012/js-link-for-sharepoint-2013-web- partsa-quick-functional-primer/ ā€¢ Knockout.js http://knockoutjs.com/ ā€¢ jQuery http://jquery.com/ 10/7/2013 +1 (866) 773-9175 | SALES@ALMONDLABS.COM 32
  • 33. PRINCETON SHAREPOINT USER GROUP ā€¢ Different SharePoint discussions each month on various topics. Announced on meetup.com ā€¢ Meets 4th Wednesday of every month ā€¢ 6pm ā€“ 8pm ā€¢ Infragistics Office ā€¢ 2 Commerce Drive, Cranbury, NJ ā€¢ http://www.meetup.com/princetonSUG ā€¢ http://www.princetonsug.com

Editor's Notes

  1. ā€œLeveraging Knockout and REST to enable rich client side customizations in SharePoint 2013ā€HighlightsReview the technologies used in client side development Show examples of functional solutions developed using these technologies
  2. Possibly turn this into a timeline
  3. document.getElementsByClassName() is not supported by IE8This isnā€™t even the largest example I found online.
  4. Change this transition to type out each individual character.One line of code.
  5. - In previous iterations, Microsoft supplied ā€œObject Modelā€ implementations for specific languages such as .NET and JavaScript.