SharePoint Alerts with WCF and jQuery
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

SharePoint Alerts with WCF and jQuery

on

  • 5,051 views

Presentation from SharePoint Saturday New Zealand that used an alerting solution to show how to build 1) a custom WCF web service that returns JSON, 2) how the SP.UI JavaScript namespace is used with ...

Presentation from SharePoint Saturday New Zealand that used an alerting solution to show how to build 1) a custom WCF web service that returns JSON, 2) how the SP.UI JavaScript namespace is used with the status bar, notifications and modal dialogues and 3) how to call web services from jQuery.

Statistics

Views

Total Views
5,051
Views on SlideShare
3,248
Embed Views
1,803

Actions

Likes
0
Downloads
27
Comments
0

8 Embeds 1,803

http://nickhadlee.wordpress.com 1792
https://nickhadlee.wordpress.com 4
url_unknown 2
http://nickhadlee.wordpress.com HTTP 1
http://translate.googleusercontent.com 1
http://webcache.googleusercontent.com 1
http://www.365dailyjournal.com 1
https://reader.aol.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

SharePoint Alerts with WCF and jQuery Presentation Transcript

  • 1. Alerts!Creating alerts using the SP 2010 UIImprovements, custom WCF servicesand jQuery
  • 2. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status Bar
  • 3. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status BarSession 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 BarIntroduction 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 BarWCF 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 BarCustom 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 BarCustom 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)
  • 9. DEMO: Custom WCF Build
  • 10. jQuery
  • 11. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status BarjQuery 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()
  • 12. User Interface Utilities – SP.UI
  • 13. SharePoint Saturday New Zealand – WCF, jQuery and the SP Status BarThe 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 BarResources 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 BarResources 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 BarNick HadleeSharePoint Consultant at IntergenBlog: nickhadlee.wordpress.comTwitter: @nickhadlee
  • 18. Questions
  • 19. Thank you to our SponsorsM S C O M M U N IT IE S