20
SharePoint 2013 JavaScript Object Model

Share point 2013 - Javascript Object Model

Embed Size (px)

DESCRIPTION

JavaScript is becoming the new de-facto standard for developing solutions on top of SharePoint, thanks to the new App model! This session will cover the fundamental use of the SharePoint 2013 JavaScript Object Model (JSOM), explain how JSOM has evolved in SharePoint 2013, and highlight many of JSOM new features.

Citation preview

Page 1: Share point 2013 - Javascript Object Model

SharePoint 2013JavaScript Object Model

Page 2: Share point 2013 - Javascript Object Model

Blog: mushannak.blogspot.ae

Twitter: @MuShannak

LinkedIn: linkedin.com/in/shannak

Slideshare:

slideshare.net/MuawiyahShannak

Website: mushannak-public.sharepoint.com

Muawiyah ShannakSharePoint Architect, MCC & UAE-

SPUG Organizer

Page 3: Share point 2013 - Javascript Object Model

JOIN THE COMMUNITY @UAESharePoint

KNOWLEDGE

SHARE

BE CONNECTE

D

Page 4: Share point 2013 - Javascript Object Model

Email : [email protected]

Website : uaesharepoint.org

Facebook: http://www.facebook.com/UAESharepoint

Twitter : @UAESharePoint

YouTube: http://www.youtube.com/UAESharePoint

LinkedIn: linkedin.com/groups/UAESharePoint-

4759377n

January, 2013

Online and in class sessions

20 Organizers, Speaker and

Contributor

Around 500 social media followers

Register Microsoft technical

Community

Page 5: Share point 2013 - Javascript Object Model

Logistics

• Questions and Interactions• Related to subject questions• Detailed questions• Questions channels : social media and our email

• Presentation & Code

• Recording

Page 6: Share point 2013 - Javascript Object Model

Agenda• CSOM intro

• How CSOM works

• CSOM Advantages

• Read list data and query

• Add/Update/Delete list

Items

Page 7: Share point 2013 - Javascript Object Model

What is CSOM• Client-Side Object Model

• API Used to develop remote applications (runs outside of SharePoint Server) Designed to be similar to the Server Object Model Introduced in SharePoint 2010, expanded in SharePoint 2013

• Three implementations .Net managed Silverlight (Plus Mobile) JavaScript (Ecmascript/JSOM)

• One Web service /_vti_bin/Client.svc

• Uses asynchronous patterns & Communication with SP done in batches

Page 8: Share point 2013 - Javascript Object Model

CSOM API

• .NET ManagedMicrosot.Sharepoint.Client.*.dll located in <15 hive>\ISAPI

• Silverlight Microsot.Sharepoint.Client.*.Sliverlight.dll located in <15 hive>\TEMPLATE\LAYOUTS\ClientBin

• PhoneMicrosot.Sharepoint.Client.*.Phone.dll located in <15 hive>\TEMPLATE\LAYOUTS\ClientBin

• JavaScriptSP.*.js located in <15 hive>\TEMPLATE\LAYOUTS

Page 9: Share point 2013 - Javascript Object Model

How Client-Side Object Model (CSOM) Work

XML

JSON

Server OMClient.svc

SharePoint ServerClient

JavaScript/Silverlight

Phone

.NET

Page 10: Share point 2013 - Javascript Object Model

CSOM Coverage

Sites & Webs Lists & Items Fields & Content Types Views & Forms Files & Folders Pages & Web Parts Features Security (Users, Groups, Roles,

Permissions) Navigation Recycle Bin Utilities

User Profiles Publishing Feeds & Sharing Search Taxonomy IRM E-Discovery Workflow Analytics BCS Language & regional

settings

Page 11: Share point 2013 - Javascript Object Model

SharePoint JavaScript CSOM

• SharePoint JavaScript CSOM, aka: SharePoint JSOM: JavaScript Object Model SharePoint ECMASecript

• A JavaScript libraires, running in the client browsers Microsoft Internet Explorer 7 and greater Firefox 3.5 and greater Safari 4.0 and greater

Page 12: Share point 2013 - Javascript Object Model

JSOM Code life cycleInitiate SP Context

Defined the required objects

Load objects

Execute Request (executeQueryAsync)

Handle Response (Success, Failure)

Page 13: Share point 2013 - Javascript Object Model

JSOM - Hello worldDemo

Page 14: Share point 2013 - Javascript Object Model

Get list items

• Get all list items and fields

• Get all list items and specific fields

Page 15: Share point 2013 - Javascript Object Model

Query list items

Page 16: Share point 2013 - Javascript Object Model

Query list items Demo

Page 17: Share point 2013 - Javascript Object Model

Add, Edit and Delete list item

• Edit list item

• Delete list item

• Add new item

Page 18: Share point 2013 - Javascript Object Model

Add, Edit and Delete list Items

Demo

Page 19: Share point 2013 - Javascript Object Model

CSOM is critical part of App Model

SharePoint apps cannot run any server-side code

Page 20: Share point 2013 - Javascript Object Model