This document was uploaded by user and they confirmed that they have the permission to share
it. If you are author or own the copyright of this book, please report to us by using this DMCA
report form. Report DMCA
Overview
Download & View 3 Livefx Cloud Apis as PDF for free.
Any programming Any platform that language that can work supports HTTP with Restful AtomPub
JavaScript
Stateful
JavaScript
Atom Publishing Protocol
Stateless Restful
Development model
Mesh Object Model Libraries
Stateful
Platforms
JavaScript on all browsers and all platforms Windows-based built Any programming on .NET 3.5 language that Silverlight 2 on all the supports .NET libraries supported browsers Windows-based built Any programming on .NET 3.5 language that Silverlight 2 on all the supports .NET libraries supported browsers and all platforms
Live Framework .NET Kit
Live Services Synchronizing Life
LiveOperatingEnvironment
Mesh
MeshObjects
Devices
NewsItems Members DataFeeds DataEntries
Contacts
News
Profiles
...
Resource Access • Relative URI • Optimistic Concurrency • HTTP verbs – GET – PUT – OPTIONS – DELETE
Returns information about the resource – – – – – – – – –
•
Authentication model Concurrency control Whether the resource is subscribable Whether the resource is extensible List of supported media types List of supported query parameters List of relationships for the resource List of supported methods (Verbs) XML Schema Definition (XSD) for the resource
Common return codes – OK – InternalServerError – PreconditionFailed
Return the second dozen Mesh Objects that are folders and sort them by title https://user.windows.net/v1.0/Mesh/MeshObjects/? $filter=(Type%20eq%20'LiveMeshFolder')&$skip=12& $take=12&$orderby=Title
Live Services Synchronizing Life
Can I automate it?
Resource Scripts
Resource Scripts
Live Services Synchronizing Life
• What are they? – Small domain specific language – Declarative way to interact with LOE – Logical equivalent of batched procedures
• Why use them? – Frees you from the lower level details of the HTTP protocol – Improves efficiency – Extend the Request processing pipeline with custom business logic
Resource Scripts • Declarative modeling for – Control Flow Statements • Sequence, Interleave, Conditional, CRUD
– Data Flow Statements • Bind statements
• Run locally or on the server • Can run as triggers • Serialized as POX or JSON
• InterleaveStatement – Executes child statements in parallel
• ConditionalStatement – If … Else … execution
• CRUD statements – Operate on resources
Live Services Synchronizing Life
Client vs Server • Server Side Execution – Script.RunAtServer(credentials) – Single HTTP request/response
• Client Side (In Process) Execution – Script.Run(credentials) – Multiple HTTP requests/responses – Each statement generates request
Live Services Synchronizing Life
Triggers
Live Services Synchronizing Life
• Attach to a resource instance • Pre and post logic on Create, Update and Delete Examples: – Create a thumbnail after an image resource is created – Remove a folder if the last child object is removed
Authoring and Running • Create the statement DOM • Compile the DOM and generate the ResourceScript instance • Execute the ResourceScript instance • If a trigger, attach to the resource
Live Services Synchronizing Life
Demo
Live Services Synchronizing Life
Resource Script Sample
To use the cloud API • Understand the Resource Model • Use standard HTTP requests • Use the format you are comfortable with