v3sdk: Store and retrieve objects in V3ctor WareHouse

Recommend this page to a friend!
     
  Info   Example   View files Files   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 29 All time: 526 This week: 3Up
Version License JavaScript version Categories
v3sdk 1.0Freeware5AJAX, Web services
Description 

Author

This object can store and retrieve objects in V3ctor WareHouse.

It can send HTTP requests to V3ctor WareHouse Web server via AJAX to perform several types of operations.

The object can take a array of properties and send requests to create a new object or update an existing object.

It can also delete objects by ID, as well retrieve objects by ID or a given property criteria.

Innovation Award
JavaScript Programming Innovation award nominee
August 2016
Number 4
Browser side applications that need to store persistent information on databases need to send the information to a server that performs the storage information.

This package can send AJAX request to a V3ctor WareHouse server so it can store and retrieve objects persistently on server side databases.

Manuel Lemos
Picture of Yorch Ponce
Name: Yorch Ponce <contact>
Classes: 2 packages by
Country: Mexico Mexico
Age: 43
All time rank: 1768 in Mexico Mexico
Week rank: 6 Up1 in Mexico Mexico Up
Innovation award
Innovation award
Nominee: 2x

Example

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="V3ctor JsonP"> <meta name="author" content="Yorch"> <title>V3ctor WareHouse JavaScript SDK</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.6/yeti/bootstrap.min.css" rel="stylesheet" integrity="sha384-yxFy3Tt84CcGRj9UI7RA25hoUMpUPoFzcdPtK3hBdNgEGnh9FdKgMVM+lbAZTKN2" crossorigin="anonymous"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="V3SDK.js"></script> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <style type="text/css"> body { padding-top: 10px; padding-bottom: 10px; } .navbar { margin-bottom: 5px; } .modal-xl { width: 90%; max-width:1200px; } .jumbotron { background-color:#FFF; } </style> <script type="text/javascript"> // Js Api Function v3 = null; // Init Jquery $(document).ready( function() { v3 = new V3SDK("https://v3-yorch.rhcloud.com/", "lYltuNtYYbYRFC7QWwHn9b5aH2UJMk1234567890"); // Option Credits $("#btn_credits").click(function() { $('#window-credits').modal('toggle'); }); // New $("#btnNew").click(function() { v3obj = {client: "V3ctor Js SDK", message: $("#txtMessage").val()}; v3.newObject("jsdk", v3obj, function(data){ console.log(data); $("#txtMessage").val(""); $("#txtId").val(V3SDK.getId(data)); }); }); // Find $("#btnFind").click(function() { var id = $("#txtId").val(); v3.findObject("jsdk", id, function(data){ console.log(data); }); }); // Query $("#btnQuery").click(function() { var id = $("#txtId").val(); var v3Query = {message: $("#txtMessage").val()}; v3.query("jsdk", v3Query, function(data){ console.log(data); }); }); // Update $("#btnUpd").click(function() { var v3obj= {msg: $("#txtMessage").val()}; var id = $("#txtId").val(); v3.updateObject("jsdk", id, v3obj, function(data){ console.log(data); }); }); // Delete $("#btnDel").click(function() { var id = $("#txtId").val(); v3.deleteObject("jsdk", id, function(data){ console.log(data); }); }); }); </script> </head> <body> <div class="container"> <nav class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#">V3ctor Js SDK</a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> <li class="active" id="btn_credits"><a href="#">Credits <span class="sr-only">(current)</span></a></li> </ul> </div> </div><!--/.container-fluid --> </nav> <div class="container"> <div class="jumbotron"> <label for="txtId">Mongo Id:</label> <input id="txtId" type="text" class="form-control" placeholder="id" name="txtId" disabled> <br> <label for="txtMessage">Message:</label> <input id="txtMessage" type="text" class="form-control" placeholder="Message" name="txtMessage"> <br> <button id="btnNew" class="btn btn-success"> NEW </button> <button id="btnFind" class="btn btn-success"> FIND </button> <button id="btnQuery" class="btn btn-success"> QUERY </button> <button id="btnUpd" class="btn btn-success"> UPD </button> <button id="btnDel" class="btn btn-success"> DEL </button> </div> </div> <!-- Static Modal Credits --> <div class="modal fade" id="window-credits" role="dialog" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title">Cr&eacute;ditos</h4> </div> <div class="modal-body"> <center> <p><h3>Jorge Alberto Ponce Turrubiates</h3></p> <p><h5><a href="mailto:the.yorch@gmail.com">the.yorch@gmail.com</a></h5></p> <p><h5><a href="http://the-yorch.blogspot.mx/">Blog</a></h5></p> <p><h5><a href="https://bitbucket.org/yorch81">BitBucket</a></h5></p> <p><h5><a href="https://github.com/yorch81">GitHub</a></h5></p> <p></p> </center> </div> </div> </div> </div> </div> </body> </html>

Details

V3ctor JavaScript Sdk

Description

V3ctor WareHouse JavaScript Sdk.

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 V3SDK.js to HTML Document.


<script src="V3SDK.js"></script>

Example


v3 = new V3SDK("https://v3-yorch.rhcloud.com/", "lYltuNtYYbYRFC7QWwHn9b5aH2UJMk1234567890");

v3obj = {client: "V3ctor Js SDK", message: "Hello World"};

// New Object
v3.newObject("jsdk", v3obj, function(data){
  console.log(data);
  
  console.log(V3SDK.getId(data));
});

var id = "57a9f2e4409b60347e8b4567";

// Find by Id
v3.findObject("jsdk", id, function(data){
  console.log(data);
});

var v3Query = {message: "Hello World"};

// Query
v3.query("jsdk", v3Query, function(data){
  console.log(data);
});

v3obj = {msg: "msg updated"};

// Update Object by Id
v3.updateObject("jsdk", id, v3obj, function(data){
  console.log(data);
});

// Delete Object
v3.deleteObject("jsdk", id, function(data){
  console.log(data);
});

References

https://en.wikipedia.org/wiki/JSONP

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


  Files folder image Files (4)  
File Role Description
Accessible without login Plain text file example.html Example Documentation
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Example script
Plain text file V3SDK.js Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:29
This week:0
All time:526
This week:3Up