SlideShare a Scribd company logo
zembly Programming Model



Srividhya Narayanan, Sr. Engineering Manager


                                               1
Agenda
• Building Blocks
• Language Reference
• Web APIs
• Building a FB application




                              2
Building Blocks
• Widgets
     > Are ...
           ● User interface (rendered in browser)
• Data Services
     > Are …
           ● Back-end logic
• API
        > Are …
              ● Externally available value-added services




                                                            3
Widgets
• Are...
      > 3 things – HTML, CSS, JavaScript
      > Flavors
            ● FB: FBML, FBJS




                                           4
Data Services
• Are...
      > JavaScript 1.6 including E4X
      > Called from widgets or from other services




                                                     5
API
• Are...
      > RESTful services
      > WADL(Web Application Description Language)
          described
      > Called from other widgets and services
      > Keyset managed in zembly




                                                     6
Language Reference




                     7
Data Services
• Input
   // Get value of a parameter
  var a = Parameters.param1;


• Output
   // Returning a String
  return quot;Hello world!quot;;

  // Returning an Object
  return { foo: quot;barquot; };




                                 8
Data Services
Calling a service from other service
 • Calling zembly created Data service – Using Things
   object
  var result = Things.codename.serviceName(parameters);
• Calling external Web API - Using Web object
  var result = Web.domain.api.serviceName(parameters);
• Passing identity credentials
     > From keychain using Owner.keychain
     > Generating on the fly




                                                          9
Data Services
Error Occurs when
 • Problems with the request or caller, for example, a
   required parameter wasn't specified
 • Syntax errors in the service code
 • JavaScript runtime errors in the service code, such as
   reference to undefined variable
 • Uncaught errors from a nested service invocation
 • Errors thrown from the service code
 • Platform errors




                                                            10
Data Services
Error Object
 • error.code - Error code returned by the service, or by the
   platform. Error code is always included.
 • error.message - Message may provide a quot;human
   readablequot; information about the error.
 • error.details - Details property may carry a structured
   information about the error.
 • error.httpStatusCode - HTTP status code that was used
   in the service response.




                                                                11
Data Services
• Error Handling
     > Using try-catch block
     > Throwing errors from services
• Logging in Services
     > Log.write(message)
     > Log.log(message)
     > Log.debug
     > Log.info
           ● All these 4 methods currently add a message to the
                execution log with info level.
     > Log.warn - Adds a message to the execution log with
         warning level
     > Log.error - Adds a message to the execution log with
         error level

                                                                  12
Widgets
• Parameters
     > As properties of Parameter object:
       Parameters.x
     > As Markup expressions:
       <h1>Hello ${Parameter.name}</h1>
     > Markup with a scriptlet
       <h1>Hi <?=${Parameter.name}</h1>




                                            13
Widgets
• Calling a service from a widget
      > service invocations from widgets are asynchronous
      > Things.callService(serviceName, parameters,
           options)
      > Web.callService(serviceName, parameters,
           options) -
           http://zembly.com/things/cb1812d5a786455b82
           331045884ca7f9
• Service invocation callbacks
     > options.onSuccess : function(data)
     > options.onSuccess : function(data, transport,
          options)
     > Service result comes back in data parameter
     > options.onFailure : function(error)
     > Error parameter contains the code, message, HTTP status
          code and details of the error.

                                                                 14
Widgets
• Logging
     > Alert()
     > Log object
          ● default logging is turned off when executing
               published widgets;
• Keychain
     > Not available




                                                           15
Web APIs




           16
17
API
• Zembly exposed Web APIs
• Bring Your Own API into zembly.
  http://wiki.zembly.com/wiki/Bring_Your_Own_API
• NetBeans WADL designer.
  http://www.netbeans.org/kb/docs/websvc/wadl-zembly.html




                                                        18
Facebook Demo




                19
Thank You!



srividhya.narayanan@sun.com


                              20

More Related Content

Similar to Zembly Programming Language

Google G Data Reading And Writing Data On The Web
Google G Data Reading And Writing Data On The WebGoogle G Data Reading And Writing Data On The Web
Google G Data Reading And Writing Data On The Web
QConLondon2008
 
Google G Data Reading And Writing Data On The Web 1
Google G Data Reading And Writing Data On The Web 1Google G Data Reading And Writing Data On The Web 1
Google G Data Reading And Writing Data On The Web 1
QConLondon2008
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
Association Paris-Web
 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009
Christopher Judd
 
How to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptxHow to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptx
Channa Ly
 
A Web Developer's Journey across different versions of ASP.NET
A Web Developer's Journey across different versions of ASP.NETA Web Developer's Journey across different versions of ASP.NET
A Web Developer's Journey across different versions of ASP.NET
Harish Ranganathan
 
Service workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua PerformanceService workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua Performance
Piero Bellomo
 
Open Social Summit Korea
Open Social Summit KoreaOpen Social Summit Korea
Open Social Summit Korea
Arne Roomann-Kurrik
 
Harish Understanding Aspnet
Harish Understanding AspnetHarish Understanding Aspnet
Harish Understanding Aspnet
rsnarayanan
 
iPhone Development For Experienced Web Developers
iPhone Development For Experienced Web DevelopersiPhone Development For Experienced Web Developers
iPhone Development For Experienced Web Developers
lisab517
 
Form Validation NG
Form Validation NGForm Validation NG
Form Validation NG
joaopmaia
 
Warden Introduction
Warden IntroductionWarden Introduction
Warden Introduction
hassox
 
Introduction to Web Programming with Perl
Introduction to Web Programming with PerlIntroduction to Web Programming with Perl
Introduction to Web Programming with Perl
Dave Cross
 
Frank Mantek Google G Data
Frank Mantek Google G DataFrank Mantek Google G Data
Frank Mantek Google G Data
deimos
 
Consuming GRIN GLOBAL Webservices
Consuming GRIN GLOBAL WebservicesConsuming GRIN GLOBAL Webservices
Consuming GRIN GLOBAL Webservices
Edwin Rojas
 
Jsf Ajax
Jsf AjaxJsf Ajax
Jsf Ajax
rajivmordani
 
Connecting to Web Services on Android
Connecting to Web Services on AndroidConnecting to Web Services on Android
Connecting to Web Services on Android
sullis
 
Yogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’s
Yogesh Kushwah
 
How LinkedIn changed its security model in order to offer an API
How LinkedIn changed its security model  in order to offer an APIHow LinkedIn changed its security model  in order to offer an API
How LinkedIn changed its security model in order to offer an API
LinkedIn
 
Comet from JavaOne 2008
Comet from JavaOne 2008Comet from JavaOne 2008
Comet from JavaOne 2008
Joe Walker
 

Similar to Zembly Programming Language (20)

Google G Data Reading And Writing Data On The Web
Google G Data Reading And Writing Data On The WebGoogle G Data Reading And Writing Data On The Web
Google G Data Reading And Writing Data On The Web
 
Google G Data Reading And Writing Data On The Web 1
Google G Data Reading And Writing Data On The Web 1Google G Data Reading And Writing Data On The Web 1
Google G Data Reading And Writing Data On The Web 1
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009
 
How to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptxHow to build Simple yet powerful API.pptx
How to build Simple yet powerful API.pptx
 
A Web Developer's Journey across different versions of ASP.NET
A Web Developer's Journey across different versions of ASP.NETA Web Developer's Journey across different versions of ASP.NET
A Web Developer's Journey across different versions of ASP.NET
 
Service workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua PerformanceService workers - Forza lavoro al servizio della tua Performance
Service workers - Forza lavoro al servizio della tua Performance
 
Open Social Summit Korea
Open Social Summit KoreaOpen Social Summit Korea
Open Social Summit Korea
 
Harish Understanding Aspnet
Harish Understanding AspnetHarish Understanding Aspnet
Harish Understanding Aspnet
 
iPhone Development For Experienced Web Developers
iPhone Development For Experienced Web DevelopersiPhone Development For Experienced Web Developers
iPhone Development For Experienced Web Developers
 
Form Validation NG
Form Validation NGForm Validation NG
Form Validation NG
 
Warden Introduction
Warden IntroductionWarden Introduction
Warden Introduction
 
Introduction to Web Programming with Perl
Introduction to Web Programming with PerlIntroduction to Web Programming with Perl
Introduction to Web Programming with Perl
 
Frank Mantek Google G Data
Frank Mantek Google G DataFrank Mantek Google G Data
Frank Mantek Google G Data
 
Consuming GRIN GLOBAL Webservices
Consuming GRIN GLOBAL WebservicesConsuming GRIN GLOBAL Webservices
Consuming GRIN GLOBAL Webservices
 
Jsf Ajax
Jsf AjaxJsf Ajax
Jsf Ajax
 
Connecting to Web Services on Android
Connecting to Web Services on AndroidConnecting to Web Services on Android
Connecting to Web Services on Android
 
Yogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’s
 
How LinkedIn changed its security model in order to offer an API
How LinkedIn changed its security model  in order to offer an APIHow LinkedIn changed its security model  in order to offer an API
How LinkedIn changed its security model in order to offer an API
 
Comet from JavaOne 2008
Comet from JavaOne 2008Comet from JavaOne 2008
Comet from JavaOne 2008
 

Recently uploaded

dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
marufrahmanstratejm
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
Data Hops
 

Recently uploaded (20)

dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3FREE A4 Cyber Security Awareness  Posters-Social Engineering part 3
FREE A4 Cyber Security Awareness Posters-Social Engineering part 3
 

Zembly Programming Language

  • 1. zembly Programming Model Srividhya Narayanan, Sr. Engineering Manager 1
  • 2. Agenda • Building Blocks • Language Reference • Web APIs • Building a FB application 2
  • 3. Building Blocks • Widgets > Are ... ● User interface (rendered in browser) • Data Services > Are … ● Back-end logic • API > Are … ● Externally available value-added services 3
  • 4. Widgets • Are... > 3 things – HTML, CSS, JavaScript > Flavors ● FB: FBML, FBJS 4
  • 5. Data Services • Are... > JavaScript 1.6 including E4X > Called from widgets or from other services 5
  • 6. API • Are... > RESTful services > WADL(Web Application Description Language) described > Called from other widgets and services > Keyset managed in zembly 6
  • 8. Data Services • Input // Get value of a parameter var a = Parameters.param1; • Output // Returning a String return quot;Hello world!quot;; // Returning an Object return { foo: quot;barquot; }; 8
  • 9. Data Services Calling a service from other service • Calling zembly created Data service – Using Things object var result = Things.codename.serviceName(parameters); • Calling external Web API - Using Web object var result = Web.domain.api.serviceName(parameters); • Passing identity credentials > From keychain using Owner.keychain > Generating on the fly 9
  • 10. Data Services Error Occurs when • Problems with the request or caller, for example, a required parameter wasn't specified • Syntax errors in the service code • JavaScript runtime errors in the service code, such as reference to undefined variable • Uncaught errors from a nested service invocation • Errors thrown from the service code • Platform errors 10
  • 11. Data Services Error Object • error.code - Error code returned by the service, or by the platform. Error code is always included. • error.message - Message may provide a quot;human readablequot; information about the error. • error.details - Details property may carry a structured information about the error. • error.httpStatusCode - HTTP status code that was used in the service response. 11
  • 12. Data Services • Error Handling > Using try-catch block > Throwing errors from services • Logging in Services > Log.write(message) > Log.log(message) > Log.debug > Log.info ● All these 4 methods currently add a message to the execution log with info level. > Log.warn - Adds a message to the execution log with warning level > Log.error - Adds a message to the execution log with error level 12
  • 13. Widgets • Parameters > As properties of Parameter object: Parameters.x > As Markup expressions: <h1>Hello ${Parameter.name}</h1> > Markup with a scriptlet <h1>Hi <?=${Parameter.name}</h1> 13
  • 14. Widgets • Calling a service from a widget > service invocations from widgets are asynchronous > Things.callService(serviceName, parameters, options) > Web.callService(serviceName, parameters, options) - http://zembly.com/things/cb1812d5a786455b82 331045884ca7f9 • Service invocation callbacks > options.onSuccess : function(data) > options.onSuccess : function(data, transport, options) > Service result comes back in data parameter > options.onFailure : function(error) > Error parameter contains the code, message, HTTP status code and details of the error. 14
  • 15. Widgets • Logging > Alert() > Log object ● default logging is turned off when executing published widgets; • Keychain > Not available 15
  • 16. Web APIs 16
  • 17. 17
  • 18. API • Zembly exposed Web APIs • Bring Your Own API into zembly. http://wiki.zembly.com/wiki/Bring_Your_Own_API • NetBeans WADL designer. http://www.netbeans.org/kb/docs/websvc/wadl-zembly.html 18