32
Drupal Services and the tasty backbone.js www.wearepropeople.com Nagailic Sergiu | Nikro

Drupal services and the tasty backbone.js

Embed Size (px)

Citation preview

Drupal Services and the tasty backbone.js

www.wearepropeople.com

Nagailic Sergiu | Nikro

www.wearepropeople.com

Content:1. Introduction to Web Services.2. Say Hi to the Services module.3. More about Services module. Expanding the module (creating resources).4. Services working example (demo).5. Say Hi to backbone.js.6. Friendship between Drupal and backbone.js.7. Backbone.js working example (demo).8. Round-up.

www.wearepropeople.com

Introduction to Web Services:

● XML-RPC / SOAP based Services● JavaScript Services (where most of them are either RPC or RESTful)● RESTful Services● Other

www.wearepropeople.com

Why do we need Services?

www.wearepropeople.com

Why do we need Services?

www.wearepropeople.com

Why do we need Services?

www.wearepropeople.com

Why do we need Services?

www.wearepropeople.com

Clients…

www.wearepropeople.com

Approach 1: XML-RPC...XML-RPC is a remote procedure call which uses XML to encode its calls and HTTP as a transport mechanism. "XML-RPC" also refers generically to the use of XML for remote procedure call, independently of the specific protocol.

www.wearepropeople.com

XML Messages:

www.wearepropeople.com

In result our API might look like:

www.wearepropeople.com

SOAP:SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks. It relies on Extensible Markup Language (XML) for its message format, and usually relies on other Application Layer protocols, most notably Hypertext Transfer Protocol (HTTP) and Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission.

www.wearepropeople.com

Basic SOAP Structure:

www.wearepropeople.com

API approach | Usage:

www.wearepropeople.com

API approach | Usage:

www.wearepropeople.com

REST / RESTful APIsREpresentational State Transfer (REST) is a style of software architecture for distributed systems such as the World Wide Web. REST has emerged over the past few years as a predominant Web service design model. REST has increasingly displaced other design models such as SOAP and WSDL due to its simpler style.

www.wearepropeople.com

REST / RESTful APIs

www.wearepropeople.com

REST / RESTful APIs

www.wearepropeople.com

REST / RESTful APIs

www.wearepropeople.com

REST / RESTful APIs

www.wearepropeople.com

Hello Services Module!

www.wearepropeople.com

Hello Services Module!

www.wearepropeople.com

Expanding the Module.Creating own Resources.Working example.

DEMO / LIVE

www.wearepropeople.com

Hello backbone.js!Backbone is a JavaScript framework/API with a RESTful JSON interface, and is loosely based on the model–view–controller (MVC) application design paradigm.

www.wearepropeople.com

Tasty Friendship

● Models (ie. Nodes)● Collections (Views or Index)● Views (Renders JS to HTML)

www.wearepropeople.com

Backbone.js working example.

DEMO / LIVE

www.wearepropeople.com

Round-up.