Icontem

File: README.md

Recommend this page to a friend!
  Classes of Yorch Ponce  >  netWf  >  README.md  >  Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Example
Class: netWf
API client to access netDB databases
Author: By
Last change:
Date: 3 years ago
Size: 2,367 bytes
 

Contents

Class file image Download

netWf 4 JavaScript

Description

netDb Web Framework JavaScript Client.

Requirements

Developer Documentation

JsDoc.

Installation

Add Jquery to HTML Document.


<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>

Add netWf.js to HTML Document.


<script src="/web/js/netWf.js"></script>

Example


api = new netWf("12345678987654321"); 

// Get Rows with limit
api.table('test', 10,
    function(response, status){
      if (status == "success"){
        console.log(response);
      }
      else
        console.log("Error in Status");
    });

// Get one row by id
api.tableById('test', 'id', 958,
    function(response, status){
      if (status == "success"){
        console.log(response);
      }
      else
        console.log("Error in Status");
    });

// Get First Row
api.first('test', 'id', '*',
    function(response, status){
      if (status == "success"){
        console.log(response);
      }
      else
        console.log("Error in Status");
    });

// Get Previous Row
api.previous('test', 'id', 10, '*',
    function(response, status){
      if (status == "success")
        console.log(response);
      else
        console.log("Error in Status");
    });

// Get Next Row
api.next('test', 'id', 10, '*',
    function(response, status){
      if (status == "success")
        console.log(response);
      else
        console.log("Error in Status");
    });

// Get Last Row
api.last('test', 'id', '*',
    function(response, status){
      if (status == "success")
        console.log(response);
      else
        console.log("Error in Status");
    });

// Execute Stored Procedure
api.procedure('usp_instest', {'@number':666},
    function(response, status){
      if (status == "success"){
        console.log(response);            
      }
      else
        console.log("Error in Status");
    });

// Execute SQL Script
api.script('script1.sql', {'@number':666},
    function(response, status){
      if (status == "success"){
        console.log(response);            
      }
      else
        console.log("Error in Status");
    });
    

References

https://es.wikipedia.org/wiki/Representational_State_Transfer

P.D. Let's go play !!!