Skip to content

JSONPParent.js

Paul L. Cimino edited this page Nov 15, 2013 · 4 revisions

JSONPParent.js

Parent Kind for all JSONP Kinds. JSONP isn't really necessary, I just started doing it for the GET calls and kept going with the pattern

Most child Kinds simply define the REST API, some override the processResponse() and processError(), as necessary.

Example of use

  • PublicView.js: mvcApp.waterfall('onCheckDB');
  • PublicController.js: checkDB: function(inSender, inEvent) { var checkDB = new JSONP.CheckDB({owner:this, fireEvent:'onCheckDBResult'}); checkDB.makeRequest({}); }
  • PublicController.js: checkDBResult: function(inSender, inEvent) { if (!inEvent.dbAvailable) { mvcApp.broadcast.displayClass = 'error'; mvcApp.showErrorMessage("Cannot connect to the Database", "We're experiencing networking issues, please try again later."); } else { // mvcApp.showInfoMessage("Database is up.", "Database is up."); } }

#../

\enyo-mvc-web-app
      |
      +---index html
      +---mvcApp html
      +---mvcAppDebug html
      +---package json
      +---node-server js
      +---mvcApp html
      +---assets
      +---enyo
      +---lib
      +---node_modules
      +---public
      +---scripts
      |
      \---source
            |
            +---apps
            +---controllers
            |     |
            |     +---auth
            |     \---public
            |
            +---css
            +---ext
            +---models
            |     |
            |     +---ajax
            |     \---socket
            |
            \---views
               |
               +---auth
               |     |
               |     \---body
               |
               \---public
                  |
                  \---body

Purpose

Project Background

Quick Start

Quick Start

Tutorial Walk Through

Add a Contact Page for Authorized users

Project Architecture

Application Architecture

Architectural Decisions

Why is the project structured this way?

Implementation Decisions

Why are some things implemented this way?

Known Issues

Package Layout & Code Inheritance

Home

Home

Clone this wiki locally