SlideShare a Scribd company logo
1 of 24
PhoneGapAnd_jQueryMobileFor
   SharePoint

var MobileWebInSharePoint = {
    Author: ‘Kiril Iliev’,
    Tags: [‘SharePointAPI’, ‘MobileWeb’]
};
Summary


    What is PhoneGap?

    PhoneGap.ProjectStructure

    Short DEMO and Tips

    SharePoint.Communication

    DEMO – CRUD with SharePoint 2013 REST
    Services
What is PhoneGap?




PhoneGap is a collection of tools, and libraries
that allow you to build native mobile
applications for multiple devices.*


                                     * PhoneGap Site
What is PhoneGap? Re-usability
PhoneGap.ProjectStrucutre


    The www folder

    App Init – index.js and index.html

    Enable debug information

    Loading plugins

    App information
DEMO
PhoneGap Project Structure
SharePoint.Communication



• Using ASMX Services and SOAP Messages
• Using SVC services
• Using the API – SharePoint 2013 _api
SharePoint.Communication = {
    asmxService: true
};



object = {
     spSite: $("#spSite").val() + "_vti_bin/authentication.asmx",
     spSoap: 
        "<?xml version='1.0' encoding='utf-8; ?>" +
        "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-
     instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
     >" +
                 "<soap:Body>" +
                         "<Login xmlns='http://schemas.microsoft.com/sharepoint/soap/'>" +
                                  "<username>" + window.localStorage.getItem("username") + "</username>" +
                                  "<password>" + window.localStorage.getItem("username") + "<password>" +
                         "</Login>" +
                 "</soap:Body>" +
        "</soap:Envelope>"
}
 
SharePoint.Communication = {
    svcServices: true
};




$.getJSON($("#spSite").val() + "/_vti_bin/listdata.svc/Birthdays", function (data) {     
       $.each(data.d.results, function (i, item) {         
               var output = "<li><a href='#' data-theme='b' data-icon='gear' >" + $(this).attr("ows_Title") + "</a></li>";         
               $("#spListView").append(output);     
       });
       $("#spListView").listview("refresh");
});
SharePoint.Communication = {
    sp2013API: true
};




GetListItems: function (params, onSuccessFunc, onErrorFunc) {         
           var xhr = $.ajax({             
                        headers: {
                            "Authorization": spListViewModel.cryptBasicAuth(window.localStorage.getItem("username"),
                                                                                 window.localStorage.getItem("password")),
                            "ACCEPT": "application/json;odata=verbose", //or application/atom+xml                 
                            "X-RequestDigest": params.formDigest             
                        },
                        url: params.spSite,
                        type: "POST",
                        dataType: "json",
                        contentType: "application/json;odata=verbose",
                        success: onSuccessFunc,
                        error: onErrorFunc
         });
}
SharePoint.Communication = {
    sp2013API.Extend: true
};




• _api alias for _api_bin/client.svc
• All new functionalities in _api are presented
  in the _api_bin/client.svc as well
• Querying is similar to the Managed Client
  Object Model
SharePoint.Communication = {
    sp2013API.ServiceEndPoints: […]
};



Area                                  Access point
Site                                  http://sitecollection/_api/site
Web                                   http://sitecollection/_api/web
                                      http://
User Profile                          sitecollection/_api/SP.UserProfiles.Peo
                                      pleManager
Search                                http://sitecollection/_api/search
Publishing                            http://sitecollection/_api/publishing
DEMO
Service End Points
SharePoint.Communication = {
    CRUD.Read: {…}
};


• GET request
• Accept Header
   •   application/json;odata=verbose //or
       application/atom+xml
DEMO
SharePoint.ReadData
SharePoint.Communication = {
    CRUD.Create: {…}
};


• Sending the FormDigest Header
   •   X-RequestDigest header inside the SharePoint context
   •   X-RequestDigest header outside the SharePoint context

• __metadata ‘type’ property required
   •   List name dependent
   •   Conflicts with different lists
DEMO
SharePoint.CreateData
SharePoint.Communication = {
    CRUD.Delete: {…}
};




• If-Match header
• RequestType: ‘DELETE’
• ItemIdentification(ID)
• …and do not forget the FormDigest, of
  course
DEMO
SharePoint.DeleteData
SharePoint.Communication = {
    CRUD.Update: {…}
};




•If-Match header – etag identification
•RequestType: ‘PUT’ or ‘MERGE’
•Do I need to mention the FormDigest?
DEMO
SharePoint.UpdateData
Thanks to our Sponsors:
Diamond Sponsor:



Platinum Sponsors:




Gold Sponsors:



Swag Sponsors:

Media Partners:
Expect very soon: SharePoint Saturday!




  Saturday, June 8, 2013
  Same familiar format – 1 day filled with sessions focused on
    SharePoint technologies
  Best SharePoint professionals in the region
  Registrations will be open next week (15th)!
  www.SharePointSaturday.eu

More Related Content

What's hot

SharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelSharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object Model
Phil Wicklund
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
SharePoint Saturday NY
 
Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)
Keshab Nath
 
SPTechCon - Share point and jquery essentials
SPTechCon - Share point and jquery essentialsSPTechCon - Share point and jquery essentials
SPTechCon - Share point and jquery essentials
Mark Rackley
 

What's hot (20)

Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePoint
 
Leveraging the Chaos tool suite for module development
Leveraging the Chaos tool suite  for module developmentLeveraging the Chaos tool suite  for module development
Leveraging the Chaos tool suite for module development
 
Unity Connect Haarlem 2016 - The Lay of the Land of Client-Side Development c...
Unity Connect Haarlem 2016 - The Lay of the Land of Client-Side Development c...Unity Connect Haarlem 2016 - The Lay of the Land of Client-Side Development c...
Unity Connect Haarlem 2016 - The Lay of the Land of Client-Side Development c...
 
API REST et client Javascript - Nuxeo Tour 2014 - Workshop
API REST et client Javascript - Nuxeo Tour 2014 - WorkshopAPI REST et client Javascript - Nuxeo Tour 2014 - Workshop
API REST et client Javascript - Nuxeo Tour 2014 - Workshop
 
Test2
Test2Test2
Test2
 
SharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelSharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object Model
 
Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST API
 
2010 - Developer look at the Client Object Model
2010 - Developer look at the Client Object Model2010 - Developer look at the Client Object Model
2010 - Developer look at the Client Object Model
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
 
More object oriented development with Page Type Builder
More object oriented development with Page Type BuilderMore object oriented development with Page Type Builder
More object oriented development with Page Type Builder
 
Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)
 
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web App
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web AppMolly Holzschlag - How HTML 5 is Going to Completely Change your Web App
Molly Holzschlag - How HTML 5 is Going to Completely Change your Web App
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
PHP, OAuth, Web Services and YQL
PHP, OAuth, Web Services and YQLPHP, OAuth, Web Services and YQL
PHP, OAuth, Web Services and YQL
 
SPTechCon - Share point and jquery essentials
SPTechCon - Share point and jquery essentialsSPTechCon - Share point and jquery essentials
SPTechCon - Share point and jquery essentials
 
Enable Domino Data Access Services (DAS)
Enable Domino Data Access Services (DAS)Enable Domino Data Access Services (DAS)
Enable Domino Data Access Services (DAS)
 
WD-Veselin Obradovic
WD-Veselin ObradovicWD-Veselin Obradovic
WD-Veselin Obradovic
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 
Web 2 0 Technologies
Web 2 0 TechnologiesWeb 2 0 Technologies
Web 2 0 Technologies
 

Viewers also liked

Shofiadinasoal
ShofiadinasoalShofiadinasoal
Shofiadinasoal
Dina Rizki
 
P16 sharing online resources
P16 sharing online resourcesP16 sharing online resources
P16 sharing online resources
Art Esposito
 

Viewers also liked (19)

Triptico 1
Triptico 1Triptico 1
Triptico 1
 
Pelota
PelotaPelota
Pelota
 
Shofiadinasoal
ShofiadinasoalShofiadinasoal
Shofiadinasoal
 
簡單認識多元性別
簡單認識多元性別簡單認識多元性別
簡單認識多元性別
 
1042_love_music_activity_speech
1042_love_music_activity_speech1042_love_music_activity_speech
1042_love_music_activity_speech
 
03_religion_su_0527_slides
03_religion_su_0527_slides03_religion_su_0527_slides
03_religion_su_0527_slides
 
Radpeer és szakmai minőségkontroll
Radpeer és szakmai minőségkontrollRadpeer és szakmai minőségkontroll
Radpeer és szakmai minőségkontroll
 
P16 sharing online resources
P16 sharing online resourcesP16 sharing online resources
P16 sharing online resources
 
CUNY Commons Personas
CUNY Commons PersonasCUNY Commons Personas
CUNY Commons Personas
 
Savvy Social Media for Open Source Communities
Savvy Social Media for Open Source CommunitiesSavvy Social Media for Open Source Communities
Savvy Social Media for Open Source Communities
 
Mico de cheiro
Mico de cheiroMico de cheiro
Mico de cheiro
 
Day to day life
Day to day lifeDay to day life
Day to day life
 
You Don't Have to Moodle: Ways to leverage the power of Wordpress for online ...
You Don't Have to Moodle: Ways to leverage the power of Wordpress for online ...You Don't Have to Moodle: Ways to leverage the power of Wordpress for online ...
You Don't Have to Moodle: Ways to leverage the power of Wordpress for online ...
 
artrial disorder managent and nursing care plan
artrial disorder managent and nursing care plan artrial disorder managent and nursing care plan
artrial disorder managent and nursing care plan
 
Work Management in SharePoint 2013 - What it is and why you'll love it
Work Management in SharePoint 2013 - What it is and why you'll love itWork Management in SharePoint 2013 - What it is and why you'll love it
Work Management in SharePoint 2013 - What it is and why you'll love it
 
Jenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsJenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with Jenkins
 
創意履歷
創意履歷 創意履歷
創意履歷
 
AP As Chief Compliance Officer - How eInvoicing Can Stop Savings Leakage and ...
AP As Chief Compliance Officer - How eInvoicing Can Stop Savings Leakage and ...AP As Chief Compliance Officer - How eInvoicing Can Stop Savings Leakage and ...
AP As Chief Compliance Officer - How eInvoicing Can Stop Savings Leakage and ...
 
行政院簡報 衛福部(媒體版簡報)
行政院簡報 衛福部(媒體版簡報)行政院簡報 衛福部(媒體版簡報)
行政院簡報 衛福部(媒體版簡報)
 

Similar to jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013

[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
lanslote
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint Apps
Liam Cleary [MVP]
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
SPTechCon
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps Offline
Pedro Morais
 
SharePoint Silverlight Sandboxed solutions
SharePoint Silverlight Sandboxed solutionsSharePoint Silverlight Sandboxed solutions
SharePoint Silverlight Sandboxed solutions
Phil Wicklund
 

Similar to jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013 (20)

Share point hosted add ins munich
Share point hosted add ins munichShare point hosted add ins munich
Share point hosted add ins munich
 
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
 
JavaOne Brasil 2016: JavaEE e HTML5: da web/desktop ao mobile
JavaOne Brasil 2016: JavaEE e HTML5: da web/desktop ao mobileJavaOne Brasil 2016: JavaEE e HTML5: da web/desktop ao mobile
JavaOne Brasil 2016: JavaEE e HTML5: da web/desktop ao mobile
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint Apps
 
SharePoint 2013 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIs
 
SharePoint and Office Development Workshop
SharePoint and Office Development WorkshopSharePoint and Office Development Workshop
SharePoint and Office Development Workshop
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
 
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePointSPTechCon Boston 2015 - Utilizing jQuery in SharePoint
SPTechCon Boston 2015 - Utilizing jQuery in SharePoint
 
SPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuerySPTechCon DevDays - SharePoint & jQuery
SPTechCon DevDays - SharePoint & jQuery
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
 
The SharePoint & jQuery Guide
The SharePoint & jQuery GuideThe SharePoint & jQuery Guide
The SharePoint & jQuery Guide
 
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechConThe SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
 
Introduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST APIIntroduction to the SharePoint Client Object Model and REST API
Introduction to the SharePoint Client Object Model and REST API
 
Get started with building native mobile apps interacting with SharePoint
Get started with building native mobile apps interacting with SharePointGet started with building native mobile apps interacting with SharePoint
Get started with building native mobile apps interacting with SharePoint
 
Taking Web Apps Offline
Taking Web Apps OfflineTaking Web Apps Offline
Taking Web Apps Offline
 
Deploying your static web app to the Cloud
Deploying your static web app to the CloudDeploying your static web app to the Cloud
Deploying your static web app to the Cloud
 
Security enforcement of Java Microservices with Apiman & Keycloak
Security enforcement of Java Microservices with Apiman & KeycloakSecurity enforcement of Java Microservices with Apiman & Keycloak
Security enforcement of Java Microservices with Apiman & Keycloak
 
Building a Windows Store App for SharePoint 2013
Building a Windows Store App for SharePoint 2013Building a Windows Store App for SharePoint 2013
Building a Windows Store App for SharePoint 2013
 
SharePoint Conference 2018 - Build an intelligent application by connecting i...
SharePoint Conference 2018 - Build an intelligent application by connecting i...SharePoint Conference 2018 - Build an intelligent application by connecting i...
SharePoint Conference 2018 - Build an intelligent application by connecting i...
 
SharePoint Silverlight Sandboxed solutions
SharePoint Silverlight Sandboxed solutionsSharePoint Silverlight Sandboxed solutions
SharePoint Silverlight Sandboxed solutions
 

More from Kiril Iliev

Final year master thesis presentation
Final year master thesis presentationFinal year master thesis presentation
Final year master thesis presentation
Kiril Iliev
 

More from Kiril Iliev (11)

Final year master thesis presentation
Final year master thesis presentationFinal year master thesis presentation
Final year master thesis presentation
 
Windows azure bcs
Windows azure bcsWindows azure bcs
Windows azure bcs
 
Purchase process
Purchase processPurchase process
Purchase process
 
Purchase process
Purchase processPurchase process
Purchase process
 
Sales Process And Mrp
Sales Process And MrpSales Process And Mrp
Sales Process And Mrp
 
Sales Process And Mrp
Sales Process And MrpSales Process And Mrp
Sales Process And Mrp
 
Axapta Interface Guide
Axapta Interface GuideAxapta Interface Guide
Axapta Interface Guide
 
Interface Navigation Intro
Interface Navigation IntroInterface Navigation Intro
Interface Navigation Intro
 
ERP Industrial Planning
ERP  Industrial PlanningERP  Industrial Planning
ERP Industrial Planning
 
Build PHP Search Engine
Build PHP Search EngineBuild PHP Search Engine
Build PHP Search Engine
 
Friction Clutch Design
Friction Clutch DesignFriction Clutch Design
Friction Clutch Design
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013

  • 1. PhoneGapAnd_jQueryMobileFor SharePoint var MobileWebInSharePoint = { Author: ‘Kiril Iliev’, Tags: [‘SharePointAPI’, ‘MobileWeb’] };
  • 2. Summary  What is PhoneGap?  PhoneGap.ProjectStructure  Short DEMO and Tips  SharePoint.Communication  DEMO – CRUD with SharePoint 2013 REST Services
  • 3. What is PhoneGap? PhoneGap is a collection of tools, and libraries that allow you to build native mobile applications for multiple devices.* * PhoneGap Site
  • 4. What is PhoneGap? Re-usability
  • 5. PhoneGap.ProjectStrucutre  The www folder  App Init – index.js and index.html  Enable debug information  Loading plugins  App information
  • 7. SharePoint.Communication • Using ASMX Services and SOAP Messages • Using SVC services • Using the API – SharePoint 2013 _api
  • 8. SharePoint.Communication = { asmxService: true }; object = { spSite: $("#spSite").val() + "_vti_bin/authentication.asmx", spSoap:  "<?xml version='1.0' encoding='utf-8; ?>" + "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema- instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' >" + "<soap:Body>" + "<Login xmlns='http://schemas.microsoft.com/sharepoint/soap/'>" + "<username>" + window.localStorage.getItem("username") + "</username>" + "<password>" + window.localStorage.getItem("username") + "<password>" + "</Login>" + "</soap:Body>" + "</soap:Envelope>" }  
  • 9. SharePoint.Communication = { svcServices: true }; $.getJSON($("#spSite").val() + "/_vti_bin/listdata.svc/Birthdays", function (data) {      $.each(data.d.results, function (i, item) {          var output = "<li><a href='#' data-theme='b' data-icon='gear' >" + $(this).attr("ows_Title") + "</a></li>";          $("#spListView").append(output);      }); $("#spListView").listview("refresh"); });
  • 10. SharePoint.Communication = { sp2013API: true }; GetListItems: function (params, onSuccessFunc, onErrorFunc) {          var xhr = $.ajax({              headers: {                  "Authorization": spListViewModel.cryptBasicAuth(window.localStorage.getItem("username"),       window.localStorage.getItem("password")),                  "ACCEPT": "application/json;odata=verbose", //or application/atom+xml                      "X-RequestDigest": params.formDigest              },              url: params.spSite,              type: "POST",              dataType: "json",              contentType: "application/json;odata=verbose",              success: onSuccessFunc,              error: onErrorFunc          }); }
  • 11. SharePoint.Communication = { sp2013API.Extend: true }; • _api alias for _api_bin/client.svc • All new functionalities in _api are presented in the _api_bin/client.svc as well • Querying is similar to the Managed Client Object Model
  • 12. SharePoint.Communication = { sp2013API.ServiceEndPoints: […] }; Area Access point Site http://sitecollection/_api/site Web http://sitecollection/_api/web http:// User Profile sitecollection/_api/SP.UserProfiles.Peo pleManager Search http://sitecollection/_api/search Publishing http://sitecollection/_api/publishing
  • 14. SharePoint.Communication = { CRUD.Read: {…} }; • GET request • Accept Header • application/json;odata=verbose //or application/atom+xml
  • 16. SharePoint.Communication = { CRUD.Create: {…} }; • Sending the FormDigest Header • X-RequestDigest header inside the SharePoint context • X-RequestDigest header outside the SharePoint context • __metadata ‘type’ property required • List name dependent • Conflicts with different lists
  • 18. SharePoint.Communication = { CRUD.Delete: {…} }; • If-Match header • RequestType: ‘DELETE’ • ItemIdentification(ID) • …and do not forget the FormDigest, of course
  • 20. SharePoint.Communication = { CRUD.Update: {…} }; •If-Match header – etag identification •RequestType: ‘PUT’ or ‘MERGE’ •Do I need to mention the FormDigest?
  • 22.
  • 23. Thanks to our Sponsors: Diamond Sponsor: Platinum Sponsors: Gold Sponsors: Swag Sponsors: Media Partners:
  • 24. Expect very soon: SharePoint Saturday! Saturday, June 8, 2013 Same familiar format – 1 day filled with sessions focused on SharePoint technologies Best SharePoint professionals in the region Registrations will be open next week (15th)! www.SharePointSaturday.eu

Editor's Notes

  1. Question for the public: Which design pattern do you see in the index.html and js files?
  2. Explain: www folder, content type for new files Explain the interaction between HTML and JS file – creates custom events AFTER device ready Show debugging information – App.cs file Show Config.xml file – the app manifest, explain about plugins
  3. Open the feeds in the browser: http://93.152.184.204:2013/_api/contextinfo http://93.152.184.204:2013/_api/web/lists/ http://93.152.184.204:2013/_api/web/lists/getbytitle(&apos;Birthdays&apos;)/items http://93.152.184.204:2013/_api/web/lists/getbytitle(&apos;Birthdays&apos;)/items(1)