SlideShare a Scribd company logo
Alerts!
Creating alerts using the SP 2010 UI
Improvements, custom WCF services
and jQuery
SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar
SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar




Session Breakdown
 Introduction (Brief)
  There a couple of things I “prepared earlier” … a brief explanation

 WCF
  Building a custom WCF service for SharePoint 2010
  The focus will not be what the service does but how to wire it up

 jQuery
  Instead of using the ASP.NET Ajax / Script Manager lets talk to the WCF
  service with jQuery

 SharePoint 2010 UI Utilities – Status Bar, Modal Dialog and Notifications
  The UI glue to show the information to users
SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar




Introduction
 The Alert architecture
      A SharePoint List – the alert storage
      A custom WCF Service – the basic business objects / logic and
       communication mechanism
      jQuery – asynchronous data retrieval (on the client)
      SP.UI.Status – the presentation layer
WCF
SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar




WCF
 Can build SOAP, REST or Data Services
 Supports dynamic configuration using factories. SharePoint 2010
  provides 3 factories:

 Service Type                      Service Factory                       Description
 SOAP service                      MultipleBaseAddressBasicHttpBindingS Basic HTTP binding must be used,
                                   erviceHostFactory                    which creates endpoints for a service
                                                                        based on the basic HTTP binding.
 REST Service                      MultipleBaseAddressWebServiceHostF    The service factory creates endpoints
                                   actory                                with Web bindings.
 ADO.NET Data Service              MultipleBaseAddressDataServiceHostF   A data service host factory can be used.
                                   actory
SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar




Custom WCF Service in SharePoint 2010
 Can’t be deployed by a sandbox solution

 WCF isn’t 100% supported in SharePoint project templates
    Create a separate WCF Service Library and copy the files into the SharePoint
     project
    Add references to System.ServiceModel and System.Runtime.Serialization
    The service declaration (.svc) needs to be added to list of files processed for
     replaceable tokens
     http://msdn.microsoft.com/en-us/library/ee231545.aspx

 Create Alert class that represents our alerts for serialization/data
  transfer
      Alert { Title, Description, Link, Colour }
SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar




Custom WCF Service in SharePoint 2010
 Make the service ASP.NET compatible
    using System.ServiceModel.Activation

     [AspNetCompatibilityRequirements(RequirementsMode =
     AspNetCompatibilityRequirementsMode.Required)]

 Make the service REST capable
    using System.ServiceModel.Web

     [WebGet(UriTemplate = "/Alert", BodyStyle = WebMessageBodyStyle.Bare,
     ResponseFormat = WebMessageFormat.Json)]

 Using MultipleBaseAddressWebServiceHostFactory because its a REST
  service (sort of)
DEMO: Custom WCF Build
jQuery
SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar




jQuery
 We could use ASP.NET AJAX but … we won’t


 We will use jQuery to call our WCF web service
      jQuery has built in support for ajax and JSON

       jQuery.ajax()
       jQuery.getJSON()
User Interface Utilities – SP.UI
SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar




The OOTB UI Improvements in 2010
 SP.UI.Notify
      addNotification(), Notify(), removeNotification()


 SP.UI.Status
      addStatus(), appendStatus(), removeAllStatus(), removeStatus(),
       setStatusPriColor(), Status(), updateStatus()


 SP.UI.ModalDialog.showModalDialog(options)
      options is a JavaScript literal of the properties to pass this method
     e.g. var options = { url: “http://sharepoint.com” }
DEMO: How to use jQuery and SP.UI
SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar




Resources
 WCF Services in SharePoint Foundation 2010
  http://msdn.microsoft.com/en-us/library/ff521586.aspx


 Creating a Custom WCF Service in SharePoint Foundation
  http://msdn.microsoft.com/en-us/library/ff521581.aspx

 jQuery ajax and JSON
  http://api.jquery.com/jQuery.ajax/
  http://api.jquery.com/jQuery.getJSON/
SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar




Resources
 SP.UI.Notify
  http://msdn.microsoft.com/en-us/library/ff408137.aspx

 SP.UI.Status
  http://msdn.microsoft.com/en-us/library/ff412058.aspx

 SP.UI.ModalDialog
  http://msdn.microsoft.com/en-us/library/ff408909.aspx
  http://msdn.microsoft.com/en-us/library/ff411351.aspx

 Enabling Intellisense in Visual Studio
  http://msdn.microsoft.com/en-us/library/ff798328.aspx
SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar




Nick Hadlee
SharePoint Consultant at Intergen

Blog:    nickhadlee.wordpress.com
Twitter: @nickhadlee
Questions
Thank you to our Sponsors




M S C O M M U N IT IE S

More Related Content

PPTX
SharePoint 2010 Developer 101
Nick Hadlee
 
PDF
OSP206 What's New in SharePoint 2013 Search
Nick Hadlee
 
PPT
4 tools, sandboxed solutionds, web part development
icdesktop
 
PPTX
Kathryn Birstein: SharePoint 2010 Business Intelligence-Brining It All Together
SharePoint Saturday NY
 
PPTX
Eugene Rosenfeld: SharePoint Custom Field Types
SharePoint Saturday NY
 
DOCX
Anusha Padala
Anusha padala
 
PPTX
Session 5-SharePoint with Office-Donovan Follette
Mithun T. Dhar
 
PPT
2 workflows, search, disaster recovery
icdesktop
 
SharePoint 2010 Developer 101
Nick Hadlee
 
OSP206 What's New in SharePoint 2013 Search
Nick Hadlee
 
4 tools, sandboxed solutionds, web part development
icdesktop
 
Kathryn Birstein: SharePoint 2010 Business Intelligence-Brining It All Together
SharePoint Saturday NY
 
Eugene Rosenfeld: SharePoint Custom Field Types
SharePoint Saturday NY
 
Anusha Padala
Anusha padala
 
Session 5-SharePoint with Office-Donovan Follette
Mithun T. Dhar
 
2 workflows, search, disaster recovery
icdesktop
 

What's hot (20)

PPTX
Presentazione Sharepoint 2010
Decatec
 
PPTX
SharePoint Connections Coast to Coast Overview of Enterprise Content Management
Ivan Sanders
 
PPTX
Jordan Remix - SharePoint 2010
Jordan Remix
 
PPT
3 lists, libraries, share point designer, business intelligence
icdesktop
 
PPTX
Configuring SharePoint 2013 for BI scenarios
SPC Adriatics
 
PPTX
SharePoint Connections Coast to Coast Business Intelligence Solutions with Sh...
Ivan Sanders
 
PPTX
Introduction to JSLink in 2013
Sparkhound Inc.
 
PPTX
Chris givens building custom service applications
Chris Givens
 
PPTX
SharePoint Saturday Sacramento Business Intelligence with SharePoint 2010
Ivan Sanders
 
PPT
1.2 introduction
icdesktop
 
PPTX
SharePoint 2010 as a Development Platform, Ayman El-Hattab MVP
Ayman El-Hattab
 
PPTX
AX2012 Technical Track - Entreprise portal, Czesia Langoswka
dynamicscom
 
PPT
Sharepoint2
LiquidHub
 
PDF
WKDNUG SP2010 Development Presentation
Rob Wilson
 
PPTX
Ax 2012 enterprise portal development
Moutasem Al-awa
 
PPTX
Practical businerss intelligence in share point 2013
Ivan Sanders
 
PPTX
Configuração de um Portal Sharepoint 2007 e Funcionalidades de Apoio
Comunidade NetPonto
 
PPTX
SharePoint 2013 Sneak Peek
Shailen Sukul
 
PPTX
SharePoint Saturday NYC - Business Intelligence
Ivan Sanders
 
PDF
KPI Roll-Up In SharePoint 2007
PathToSharePoint
 
Presentazione Sharepoint 2010
Decatec
 
SharePoint Connections Coast to Coast Overview of Enterprise Content Management
Ivan Sanders
 
Jordan Remix - SharePoint 2010
Jordan Remix
 
3 lists, libraries, share point designer, business intelligence
icdesktop
 
Configuring SharePoint 2013 for BI scenarios
SPC Adriatics
 
SharePoint Connections Coast to Coast Business Intelligence Solutions with Sh...
Ivan Sanders
 
Introduction to JSLink in 2013
Sparkhound Inc.
 
Chris givens building custom service applications
Chris Givens
 
SharePoint Saturday Sacramento Business Intelligence with SharePoint 2010
Ivan Sanders
 
1.2 introduction
icdesktop
 
SharePoint 2010 as a Development Platform, Ayman El-Hattab MVP
Ayman El-Hattab
 
AX2012 Technical Track - Entreprise portal, Czesia Langoswka
dynamicscom
 
Sharepoint2
LiquidHub
 
WKDNUG SP2010 Development Presentation
Rob Wilson
 
Ax 2012 enterprise portal development
Moutasem Al-awa
 
Practical businerss intelligence in share point 2013
Ivan Sanders
 
Configuração de um Portal Sharepoint 2007 e Funcionalidades de Apoio
Comunidade NetPonto
 
SharePoint 2013 Sneak Peek
Shailen Sukul
 
SharePoint Saturday NYC - Business Intelligence
Ivan Sanders
 
KPI Roll-Up In SharePoint 2007
PathToSharePoint
 
Ad

Similar to SharePoint Alerts with WCF and jQuery (20)

PPT
Building+restful+webservice
lonegunman
 
PDF
Building RESTful Services with WCF 4.0
Saltmarch Media
 
PPTX
WCF Data Services - Bandung Charity Event - 2010
Andri Yadi
 
PPTX
Web API or WCF - An Architectural Comparison
Adnan Masood
 
PPTX
Parallelminds.asp.net web service
parallelminder
 
PPT
ADO.NET Data Services
ukdpe
 
PPTX
Jax ws
F K
 
PPTX
Session 7 - Integrating share point with silverlight firestarter
Mithun T. Dhar
 
PDF
Wcf remaining
shamsher ali
 
PDF
Integration of Web Service Stacks in an Esb
Wen Zhu
 
PPT
Reusing Existing Java EE Applications from SOA Suite 11g
Guido Schmutz
 
PPTX
Novidades Do Asp.Net 4 E Do Visual Studio 2010
Rodrigo Kono
 
PPTX
Oracle JET and WebSocket
andrejusb
 
PDF
Spsdc what's new in share point 2013 workflow
amitvasu
 
DOCX
Web service through cxf
Roger Xia
 
PPTX
Usability AJAX and other ASP.NET Features
Peter Gfader
 
PPTX
Web API with ASP.NET MVC by Software development company in india
iFour Institute - Sustainable Learning
 
PDF
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
mfrancis
 
PPSX
WCF LOB SDK from CodeMastery
clineer
 
PPTX
SharePoint 2010 Architecture - TechEd Brasil 2010
Michael Noel
 
Building+restful+webservice
lonegunman
 
Building RESTful Services with WCF 4.0
Saltmarch Media
 
WCF Data Services - Bandung Charity Event - 2010
Andri Yadi
 
Web API or WCF - An Architectural Comparison
Adnan Masood
 
Parallelminds.asp.net web service
parallelminder
 
ADO.NET Data Services
ukdpe
 
Jax ws
F K
 
Session 7 - Integrating share point with silverlight firestarter
Mithun T. Dhar
 
Wcf remaining
shamsher ali
 
Integration of Web Service Stacks in an Esb
Wen Zhu
 
Reusing Existing Java EE Applications from SOA Suite 11g
Guido Schmutz
 
Novidades Do Asp.Net 4 E Do Visual Studio 2010
Rodrigo Kono
 
Oracle JET and WebSocket
andrejusb
 
Spsdc what's new in share point 2013 workflow
amitvasu
 
Web service through cxf
Roger Xia
 
Usability AJAX and other ASP.NET Features
Peter Gfader
 
Web API with ASP.NET MVC by Software development company in india
iFour Institute - Sustainable Learning
 
HTTP Whiteboard - OSGI Compendium 6.0 - How web apps should have been! - R Auge
mfrancis
 
WCF LOB SDK from CodeMastery
clineer
 
SharePoint 2010 Architecture - TechEd Brasil 2010
Michael Noel
 
Ad

Recently uploaded (20)

PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
PDF
Software Development Company | KodekX
KodekX
 
PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PPTX
Stamford - Community User Group Leaders_ Agentblazer Status, AI Sustainabilit...
Amol Dixit
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
Software Development Company | KodekX
KodekX
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Stamford - Community User Group Leaders_ Agentblazer Status, AI Sustainabilit...
Amol Dixit
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
Software Development Methodologies in 2025
KodekX
 
This slide provides an overview Technology
mineshkharadi333
 

SharePoint Alerts with WCF and jQuery

  • 1. Alerts! Creating alerts using the SP 2010 UI Improvements, custom WCF services and jQuery
  • 2. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar
  • 3. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar Session Breakdown  Introduction (Brief) There a couple of things I “prepared earlier” … a brief explanation  WCF Building a custom WCF service for SharePoint 2010 The focus will not be what the service does but how to wire it up  jQuery Instead of using the ASP.NET Ajax / Script Manager lets talk to the WCF service with jQuery  SharePoint 2010 UI Utilities – Status Bar, Modal Dialog and Notifications The UI glue to show the information to users
  • 4. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar Introduction  The Alert architecture  A SharePoint List – the alert storage  A custom WCF Service – the basic business objects / logic and communication mechanism  jQuery – asynchronous data retrieval (on the client)  SP.UI.Status – the presentation layer
  • 5. WCF
  • 6. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar WCF  Can build SOAP, REST or Data Services  Supports dynamic configuration using factories. SharePoint 2010 provides 3 factories: Service Type Service Factory Description SOAP service MultipleBaseAddressBasicHttpBindingS Basic HTTP binding must be used, erviceHostFactory which creates endpoints for a service based on the basic HTTP binding. REST Service MultipleBaseAddressWebServiceHostF The service factory creates endpoints actory with Web bindings. ADO.NET Data Service MultipleBaseAddressDataServiceHostF A data service host factory can be used. actory
  • 7. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar Custom WCF Service in SharePoint 2010  Can’t be deployed by a sandbox solution  WCF isn’t 100% supported in SharePoint project templates  Create a separate WCF Service Library and copy the files into the SharePoint project  Add references to System.ServiceModel and System.Runtime.Serialization  The service declaration (.svc) needs to be added to list of files processed for replaceable tokens http://msdn.microsoft.com/en-us/library/ee231545.aspx  Create Alert class that represents our alerts for serialization/data transfer  Alert { Title, Description, Link, Colour }
  • 8. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar Custom WCF Service in SharePoint 2010  Make the service ASP.NET compatible  using System.ServiceModel.Activation [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]  Make the service REST capable  using System.ServiceModel.Web [WebGet(UriTemplate = "/Alert", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]  Using MultipleBaseAddressWebServiceHostFactory because its a REST service (sort of)
  • 11. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar jQuery  We could use ASP.NET AJAX but … we won’t  We will use jQuery to call our WCF web service  jQuery has built in support for ajax and JSON jQuery.ajax() jQuery.getJSON()
  • 13. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar The OOTB UI Improvements in 2010  SP.UI.Notify  addNotification(), Notify(), removeNotification()  SP.UI.Status  addStatus(), appendStatus(), removeAllStatus(), removeStatus(), setStatusPriColor(), Status(), updateStatus()  SP.UI.ModalDialog.showModalDialog(options)  options is a JavaScript literal of the properties to pass this method e.g. var options = { url: “http://sharepoint.com” }
  • 14. DEMO: How to use jQuery and SP.UI
  • 15. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar Resources  WCF Services in SharePoint Foundation 2010 http://msdn.microsoft.com/en-us/library/ff521586.aspx  Creating a Custom WCF Service in SharePoint Foundation http://msdn.microsoft.com/en-us/library/ff521581.aspx  jQuery ajax and JSON http://api.jquery.com/jQuery.ajax/ http://api.jquery.com/jQuery.getJSON/
  • 16. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar Resources  SP.UI.Notify http://msdn.microsoft.com/en-us/library/ff408137.aspx  SP.UI.Status http://msdn.microsoft.com/en-us/library/ff412058.aspx  SP.UI.ModalDialog http://msdn.microsoft.com/en-us/library/ff408909.aspx http://msdn.microsoft.com/en-us/library/ff411351.aspx  Enabling Intellisense in Visual Studio http://msdn.microsoft.com/en-us/library/ff798328.aspx
  • 17. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar Nick Hadlee SharePoint Consultant at Intergen Blog: nickhadlee.wordpress.com Twitter: @nickhadlee
  • 19. Thank you to our Sponsors M S C O M M U N IT IE S