Git Product home page Git Product logo

jaydata's Introduction

Notice: this library isn't maintained anymore

JayData is a unified data access library for JavaScript to CRUD data from different sources like WebSQL/SQLite, IndexedDB, MongoDb, OData, HTML5 localStorage. The library can be integrated with React, Angular2, Durandal, KendoUI, Knockout.js, Handlebars.js or Sencha Touch 2 and can be used on Node.js as well. Check out the latest JayData examples

JayData not only provides JavaScript Language Query (JSLQ) syntax to access local (in-browser and mobile) and remote databases, but builds the queries and executes/processes the requests of the essential data sources and data services to make developers able to concentrate only on the business logic.

Microsoft .NET developers can utilize Entity Framework and LINQ on server-side to perform operations on data from different databases. The aim of JayData library is to give a similar tool to JavaScript developers.

JayData is cross-platform (runs on HTML5 desktop and mobile browsers, can be hosted in Cordova/PhoneGap environment on iPhone, iPad, Android or Windows Phone 8+) and cross-layer as it works on client-side and server-side (Node.JS).

Please read the release notes for current status of the providers.

Visit http://jaydata.org for detailed information and documentation.

Official builds are released on CodePlex (http://jaydata.codeplex.com) can be used to develop applications, to get the structured sourcecode to develop JayData itself, visit http://github.com/jaystack/jaydata

Feed of Latest releases, tutorials: https://twitter.com/jaydataorg Feed of commits in development branch: https://twitter.com/jaydatadev

JayData comes with multiple licensing: you can use it under MIT license if ship software software under MIT, but it should be used under GPL if you distribute your software under GPLv2. JayData Pro is a closed-source commercial product recommended for enterprise projects and commercial development efforts. http://jaystack.com/licensing

Installation

$ npm install jaydata

How to build

$ git clone https://github.com/jaystack/jaydata.git
$ cd jaydata
$ npm install
$ gulp

Use JayData as a standalone global library

<script  type="text/javascript" src="jaydata.min.js"></script>

Providers are lazy loaded from the same location as the core JayData script under the jaydataproviders folder. If you want to use a JayData module, include it manually in a <script> tag.

Use Jaydata with System.js

Using JayData with System.js needs a little bit of a setup and you have to map all providers you want to use in your application.

var map = {
    'jaydata/core': 'lib/jaydata/jaydata.min',
    'jaydata/odata': 'lib/jaydata/jaydataproviders/oDataProvider.min'
};

var meta = {
    'jaydata/odata': {
        format: 'cjs',
        deps: ['jaydata/core']
    }
};

var config = {
    map: map,
    meta: meta
};

System.config(config);

With this setup you can now import the jaydata/odata module in your application code. See a full example in Angular2 here.

Use JayData with Require.js

If you want to use Require.js to import JayData into your application, you need to set the path configuration correctly:

requirejs.config({
    paths: {
        'jaydata/core': '../lib/jaydata/jaydata.min',
        'jaydata/odata': '../lib/jaydata/jaydataproviders/oDataProvider.min',
    }
});

See a working example using Require.js and Durandal here.

JayData basics in 7 simple steps

In most scenarios, the 7 simple steps of JayData basics are enough to handle data of your application. For more details, visit http://jaydata.org.

Step 1 - Define your data model

Simple model that works online and offline as well. Define your data model:

var Todo = $data.Entity.extend("Todo", {
    Id: { type: "int", key: true, computed: true },
    Task: { type: String, required: true, maxLength: 200 },
    DueDate: { type: Date },
    Completed: { type: Boolean }
});

var TodoDatabase = $data.EntityContext.extend("TodoDatabase", {
    Todos: { type: $data.EntitySet, elementType: "Todo" }
});

Step 2 - Initialize the data storage

OData

You can Initialize your context to handle an OData endpoint just by passing the OData service URL as a single string parameter.

var todoDB = new TodoDatabase("http://mysite.com/my.svc");

Local database

If you want to use a local database, pass the name of your database as a string. JayData automatically detects what type of local database solution is available on the client and creates a context to an IndexedDB, WebSQL, LocalStorage or InMemory database.

var todoDB = new TodoDatabase("MyTodoDatase");

WebSQL

You can even specify, what type of database you want to use by providing a storage provider configuration object.

var todoDB = new TodoDatabase({ 
    provider: 'webSql', databaseName: 'MyTodoDatabase' 
});

Step 3 - Create data

You can create new data by adding new entities to an entity set.

Simple

You can add a single entity to an entity set...

todoDB.onReady(function(){
    var task = todoDB.Todos.add({ Task: 'Step0: Get this list', Completed: true });
    todoDB.saveChanges(function(){
        alert(task.Id);
    });
});

Batch

...or you can create multiple new entities by using the addMany function. In the handler of the saveChanges function you will get how many entities were saved.

todoDB.onReady(function(){
    var tasks = todoDB.Todos.addMany([
        { Task: 'Step1: Define your data model'},
        { Task: 'Step2: Initialize the data storage'},
        { Task: 'Step3: Create data' }
    ]);
    todoDB.saveChanges(function(count){
        alert("Created " + count + " new task");
        tasks.forEach(function(todo){ alert(todo.Id); });
    });
});

Step 4 - Read data

All items

To retrieve all database items as an array, use the toArray function.

todoDB.onReady(function(){
    todoDB.Todos.toArray(function(todos){
        yourTemplate.render(todos);
    });
});

Filter #1

You can filter your data just like the native filter function of JavaScript. If you want to handle your result in a loop use the forEach function.

todoDB.onReady(function(){
    todoDB.Todos
        .filter(function(todo){
            return todo.Completed == true || todo.Task.startsWith("Step2");
        })
        .forEach(function(todo){
            yourTemplate.render(todo);
        });
});

Using forEach is equivalent to this:

todoDB.onReady(function(){
    todoDB.Todos
        .filter(function(todo){
            return todo.Completed == true || todo.Task.startsWith("Step2");
        })
        .toArray(function(todos){
            todos.forEach(function(todo){
                yourTemplate.render(todo);
            });
        });
});

Filter #2

You can pass a query parameters object as the second argument of the filter function and access these query parameters on this in the query function.

todoDB.onReady(function(){
    todoDB.Todos
        .filter(function(todo){
            return todo.Completed == true || todo.Task.startsWith(this.stepName);
        }, {
            stepName: 'Step2'
        })
        .forEach(function(todo){
            yourTemplate.render(todo); 
        });
});

Filter #3

Instead of a JavaScript function you can use a query string in the filter function. This is specially useful, when you want to create your query dynamically.

todoDB.onReady(function(){
    var stepName = 'Step2';
    todoDB.Todos
        .filter("it.Completed || it.task.startsWith('" + stepName + "')")
        .forEach(function(todo){
            yourTemplate.render(todo); 
        });
});

Mapping

In some scenarios you want to just retrieve some fields of your entity and map these fields as different names.

todoDB.onReady(function(){
    todoDB.Todos
        .map(function(todo){
            return {
                _task: todo.Task,
                _completed: todo.Completed
            }
        })
        .toArray(function(todos){
            yourTemplate.render(todos);
        });
});

Paging

As you store more and more entities in your database, it's practical to retrieve only a subset of your data by using paging functions.

todoDB.onReady(function(){
    todoDB.Todos
        .skip(2)
        .take(3)
        .toArray(function(todo){
            yourTemplate.render(todo);
        });
});

Ordering

If you want to sort your result by a selected field, use orderBy or orderByDescending. As you can still use a string instead of a function in the query function, you can dynamically construct your ordering query.

todoDB.onReady(function(){
    todoDB.Todos
        .orderBy("it.Task")
        .toArray(function(todo){
            yourTemplate.render(todo);
        });
});

If you want more dynamic control over order direction, use the order function. If you need descending ordering on the field, use the - sign before the field name.

todoDB.onReady(function(){
    todoDB.Todos
        .order("-it.Task")
        .toArray(function(todo){
            yourTemplate.render(todo);
        });
});

Step 5 - Update data

To update an entity, attach it to the context and JayData will track the changes on the entity. On calling the saveChanges function, your attached and updated entities will be saved.

todoDB.onReady(function(){
    todoDB.Todos.single("it.Id == 1", function(todo){
        todoDB.attach(todo);
        todo.Completed = true;
        todoDB.saveChanges(function(count){
            alert("Updated " + count + " task");
        });
    });
});

Step 6 - Delete data

Simple

Just like updating data, but instead of attach you will use remove.

todoDB.onReady(function(){
    todoDB.Todos.single("it.Id == 3", function(todo){
        todoDB.Todos.remove(todo);
        todoDB.saveChanges(function(count){
            alert("Removed " + count + " task");
        });
    });
});

Batch

Use the removeAll function if you want to truncate all data in a single entity set.

todoDB.onReady(function(){
    todoDB.Todos.removeAll(function(){
        alert("Removed all tasks");
    });
});

Step 7 - Generate some UI with jQuery

todoDB.onReady(function(){
    todoDB.Todos
        .forEach(function(todo) {
            $('#todos')
                .append('<li><b>' + todo.Task + '</b>' + (todo.Completed ? ' - completed' : '') + '</li>');
        });
});

Related projects

JaySvcUtil - Code generator tool that builds JayData data model classes from $metadata service of OData endpoints.

jaydata's People

Contributors

agdolla avatar borzav avatar genne5 avatar jaydata avatar jpattersonz avatar kavics avatar kildem avatar lazarv avatar limnuh avatar malyngo avatar nochtap avatar peteraronzentai avatar tbarna-jay avatar zenima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jaydata's Issues

JayStorm Authorization manager API

The API can be used with JayRPC or direct calls and is published as an OData service endpoint with FunctionImports

In direct call mode, the API can be accessed from the this.executionContext variable of the executing serivce instance

Method groups 1, check authorization:

var user = this.executionContext.user; //this could either be this.user, needs fixup from JayRPC invoke side
var authorizationResult = this.executionContext.checkPermission(requirest.user, "databaseContextName", "entitySetName | functionImportName", operationMask)

///operationMask is a bitset of the operationsEnum flags:
operations = {
  read (load any item of set): 1,
  write (new item): 2,
  update (existing item): 4,
  delete: 8,
   execute: 16,
   query: 32 // this one could be execute on sets
}

q.when(authorizationResult).then(function(result) {
  if (!result) {
   //throw or invoke promise reject 
 }
});

Method group 2, manage authorization

crud like methods with OData FunctionImport and ComplexType involved. No EntitySet however!

Question: Best practice for building dynamic JSQL expression

I'm working on a POC on SharePoint 2010 that includes knockout and jaydata.

A SharePoint site consists of one to many lists and I'm using jaydata to retrieve the information dynamically based on a selected list.

You can see a preview at http://www.spirit.de/demos/metro/ZurbV3/MetroStyleTemp.aspx.

This is the jdata relevant code

     postbox.subscribe("selectedList", function (newValue) {
            var memberDef = app.context[newValue].elementType.memberDefinitions;

            if (newValue !== '') {
                app.context[newValue]
                    .orderByDescending("'" + newValue + ".'" + orderByDescending() )
                    .include(include)
                    .map(chooseMap(newValue))
                    .take(take())
                    .toArray(allItems);
            }
        });

Full code is at https://github.com/RainerAtSpirit/FerrariMeetsJayData/blob/master/js/app/ListingViewModel.js

In order to support dynamic sorting, paging etc I started to create ko observables. This works pretty well for e.g. take(), but flipping the order is challenging as there are two order operators. Another challenge occurs for mapping as not all lists have all fields, so at the moment I'm checking for the field existence. Not ideal, so it might be better to create a base configuration e,g,

  1. define common fields (e.g. Modified, Created) and field label|labelId
  2. includes e.g CreatedBy
  3. default order field and direction e.g. Modified DESC
  4. take e.g. 10

List specific configuration that extends the base object.

Based on those settings it should create the dynamic JSQL expression.

Before going down that route I'd like to gather some feedback to see if that's feasible or if there're alternatives that should be considered.

Thanks,

Rainer

Multiple Contexts Behavior

Provider: webSql
Version: 1.1.1

We use 2 contexts in our application to separate disctinct sets of data in two databases.

We developed a configurable "toJSON" function, which retrieves all the hierarchy given an entity or set of entities. This code uses "getPublicMappedProperties()" to get the entity members and parse it recursively (see toJSON method implementation for a use example).

[entity].memberDefinitions.getPublicMappedProperties()

The problem is that on some entities, we are getting members from entities from ANOTHER Context !!!!

In that particular case, the Entity and EntitySet were called the same on both Contexts. Also, the "ghost" properties were called the same. We changed the class names and now is working correclty.

We think this is Core Issue.

Does JayData support the use of more than one context? If not, please elaborate the reason, so we can contribute.

Thanks in advance!

oData northwind deep include

northwind.Categories.include('Products').include('Products.Supplier').toArray(function(a){ console.dir(a) });

in this scenario, categories have products, but product doesn't has Supplier,

northwind.Products.include('Supplier').toArray(function(a){ console.dir(a) });
this works correctly

Safari 6 (desktop) bug

In Safari 6 (browser or mobile), the jaydata framework does not load. It gives the following error:

"TypeError: Attempted to assign to readonly property."

I've searched online and people have commented that the use of "use strict" could cause this. So I looked for this text and found it in jaydata.js in the jslint section. After commenting that out, it doesn't give the error any more but it doesn't load the data provider. I'm using sqlite. I found that the xmlhttprequest returns status code 0 instead of 200, even though the responseText is set correctly to the contents of SqliteProvider.js. Not sure why it would return status code 0, but after adding it to the code it loaded the provider:

function loadScript(url, callback) {
...
if (oXmlHttp.status == 200 || oXmlHttp.status == 304 || oXmlHttp.status == 0) {
eval.call(window, oXmlHttp.responseText);
if (typeof callback === 'function')
callback(true);
} else {
if (typeof callback === 'function') {
callback(false);
}
}
...
}

This works fine in the browser but does not work in PhoneGap. In PhoneGap, I get this error now:

"ReferenceError: Can't find variable: $data"

I've tried defining the model and creating the context before and after the deviceReady event has fired, neither works.

missing files

When running make I appear to be missing the following files from the repository:

Types/RowConverter.js
Types/StorageProviders/SqLite/ModelBinder/sqLiteModelBinderCompiler.js
Types/StorageProviders/SqLite/ModelBinder/sqLiteEFModelBinderCompiler.js
Types/StorageProviders/SqLite/ModelBinder/sqLiteOLModelBinderCompiler.js
Types/StorageProviders/oData/ModelBinder/oDataModelBinderCompiler.js
Types/StorageProviders/oData/ModelBinder/oDataEFModelBinderCompiler.js
Types/StorageProviders/oData/ModelBinder/oDataOLModelBinderCompiler.js
Tools/compiler.jar

Single throws exception or not call cb

this.filter("it." + key.name + " == this.value", { value: keyValue }).single(null, cb);

does not call cb

this.filter("it." + key.name + " == this.value", { value: keyValue }).single(cb);

throws
jaygrid.js:137
Grid model created jaygrid.js:174
template registered:Edm.String jaygrid.js:137
template registered:Edm.Boolean jaygrid.js:137
Grid model created jaygrid.js:174
VisitCall: Only fields can have operations: CallExpression jaydata.js:77
DefaultError: DEFAULT ERROR CALLBACK!

Exception
jaydata.js:75
Uncaught DefaultError: DEFAULT ERROR CALLBACK! jaydata.js:79

Updating an OData Entity with String Key

When I try to update an entity whose key property is type Edm.String I get an bad request error.

The service is expecting

http://services.odata.org/Northwind/Northwind.svc/Customers('ALFKI')

instead the code is creating the request URI as

http://services.odata.org/Northwind/Northwind.svc/Customers(ALFKI)
the quotes are missing

getEntityKeysValue:
..
keyValue = entity.data[field.name];
if (field.dataType == "string")
keyValue = "'" + keyValue + "'";
result.push(field.name + "=" + keyValue);
}
should be
if (field.dataType == "Edm.String" || ...)

Cheers
John P

Known Issue: Delete entity with include

If you include Category while querying the Articles, and you remove an article from the entity set, a new category will be created.

test('Delete_with_Include', function () {
    expect(1);
    stop(8);
    (new $news.Types.NewsContext(providerConfig)).onReady(function (db) {
        start(1);
        $news.Types.NewsContext.generateTestData(db, function () {
            start(1);
            db.Categories.map(function (item) { return item.Title; }).toArray(function (result) {
                start(1);
                console.log(result);
                var before = result.length;
                db.TagConnections.filter(function (item) { return item.Article.Id == 1; }).toArray(function (result) {
                    start(1);
                    for (var i = 0; i < result.length; i++) {
                        db.TagConnections.remove(result[i]);
                    }
                    db.saveChanges(function () {
                        start(1);
                        db.Articles.include('Category').single(function (item) { return item.Id == 1; }, null, {
                            success: function (result) {
                                start(1);
                                console.log(result);
                                db.Articles.remove(result);
                                db.saveChanges(function () {
                                    start(1);
                                    db.Categories.map(function (item) { return item.Title; }).toArray(function (result) {
                                        start(1);
                                        console.log(result);
                                        var after = result.length;
                                        equals(after, before, 'categories changed');
                                    });
                                })
                            },
                            error: function (error) {
                                console.dir(error);
                            }
                        });
                    });
                });
            });
        });
    });
});

In Cordova dynamic provider loading can not work

In Cordova we can not load scripts with XMLHttpRequest as there is no underlying webserver to address. For this reason if a provider is about to be dynamic loaded and also we are in Cordova/Titanium environment the user should be warned with a dialog box, that requests the manual reference of the provider js file into the application html.

Provide helpful exception message in case of string value of elementType

type and elementType properties must be typed values in a context declaration.

The following snippet shows the expected syntax :
$data.EntityContext.extend("$catalog.Types.catalogContext", {
Categories: { type: $data.EntitySet, elementType: $catalog.Types.Category },
Products: { type: $data.EntitySet, elementType: $catalog.Types.Product }
});

It's difficult to find define the type and elementType fields in string format. In this case we should return a detailed error message, which helps developers to fix the context definition.

Context definition to reproduce the error:

$data.EntityContext.extend("$catalog.Types.catalogContext", {
Categories : { type: "$data.EntitySet", elementType: "$catalog.Types.Category" },
Products : { type: "$data.EntitySet", elementType: "$catalog.Types.Product" }
});

1.1.1 and debugging of odata provider?

With 1.1.1 I see it's loaded and working, but I'm unable to get a hold on it in Firebug or Chrome as it won't show up in the script list. Am I missing something?

Thanks

toArray(), promise handler issue

toArray(), at line 13578 returns this:

pHandler.getPromise(): Promise
proto: Promise
always: function () { Guard.raise(new Exception('$data.Promise.always', 'Not implemented!')); }
constructor: function Promise(){
done: function () { Guard.raise(new Exception('$data.Promise.done', 'Not implemented!')); }
fail: function () { Guard.raise(new Exception('$data.Promise.fail', 'Not implemented!')); }
getType: function () {
isRejected: function () { Guard.raise(new Exception('$data.Promise.isRejected', 'Not implemented!')); }
isResolved: function () { Guard.raise(new Exception('$data.Promise.isResolved', 'Not implemented!')); }
pipe: function () { Guard.raise(new Exception('$data.Promise.pipe', 'Not implemented!')); }
progress: function () { Guard.raise(new Exception('$data.Promise.progress', 'Not implemented!')); }
promise: function () { Guard.raise(new Exception('$data.Promise.promise', 'Not implemented!')); }
state: function () { Guard.raise(new Exception('$data.Promise.state', 'Not implemented!')); }
then: function () { Guard.raise(new Exception('$data.Promise.then', 'Not implemented!')); }
proto: Base

NuGet 1.1.1 build cannot load oDataProvider

The NuGet package build (1.1.1) doesn't work. It tries to load the oDataProvider.js from /jaydataproviders/ instead of /Scripts/jayadataproviders/ which is where the package places it. Not sure how that got past the testers.

1.1.1 orderBy raises error

This is working

   postbox.subscribe("selectedList", function (newValue) {
            if (newValue !== '') {
                app.context[newValue]
                    .include(include)
                    .map(chooseMap(newValue))
                    .take(take)
                    .toArray(allItems);
            }
        });

As soon as I add orderBy() or orderByDescending() the system raises an error

Global parameter Modified not found. For query parameters use 'this.field' notation

Same error occurs if I shorten the expression:

  app.context[newValue]
                   .orderBy('Modified')
                   .toArray(allItems);

OData provider - Filter by GUID field should be supported

Filtering by GUID field should be compiled to $filter=Id eq guid'fda07801-e125-44c9-95be-0001c9407585'

The guid prefix is missing right now, which causes Error 400 on the server.

Reference: http://www.odata.org/developers/protocols/overview

The bug can be easily reproduced using the Netflix example:

Netflix.context.TitleAwards
.filter(function(ta) { return ta.Id == 'fda07801-e125-44c9-95be-0001c9407585'} )
.toArray(function (t) {console.dir(t);})

Support simple field name notation in .orderby and in .select/.map

It would be nice to support

myContext.mySet.orderBy("FieldName") 
myContext.mySet.map("FieldName") 

This should be a convenience method that in the background builds up a memberExpression as expected downwards.

The specs to decide if the predicate is a fieldNameOnlyNotation is as follows:
if predicate is string and it does not contain "it." and also does not contain a space then it should be treated as a field name of the respective entity type. The function implementation should append a "return it." prefix and fallback to the existing logic.

Overwriting Odata field conversion

What would be the recommend way to overwrite the fieldConverter object to provide your own converter functions?

fieldConverter: {
        value: {
            fromDb: {

                '$data.Date': function (dbData) { return dbData ? new Date(parseInt(dbData.substr(6))) : undefined; },

Neither tests.html, tests_JayData.html nor tests_JayData_min.html is working?

I've gotten the latest (as of today) from the development branch, mounted it in IIS express and tried loading the qunit test harness pages in Chrome. Nothing works - they all error out and fail to even load correctly. How do I run the tests to verify development builds? Are these the right files? If not, consider clearing out the junk :)

JaySvcUtil 1.0 RC1 question

Hi there,

I'm following along your OData demo at http://jaydata.org/tutorials/how-to-build-a-simple-odata-based-ajax-application, but I would like do use existing services instead of a V11 one.

  1. http://odata.netflix.com/v2/catalog/$metadata a well known OData V2.0 service ;-)
  2. http://openaccess.spirit.de/EntitiesModelService.svc/$metadata an OData service generated by OpenAccess

When running the tool for 1 I'm getting the following warnings, not sure if these are expected.

Requesting: http://odata.netflix.com/v2/catalog/$metadata... done.
Info: generating type Netflix.Catalog.v2.Genre
  Warning: Genre.Name:m:FC_TargetPath is an unknown/unprocessed attribued
  Warning: Genre.Name:m:FC_ContentKind is an unknown/unprocessed attribued
  Warning: Genre.Name:m:FC_KeepInContent is an unknown/unprocessed attribued
Info: generating type Netflix.Catalog.v2.Title
  Warning: Title.Name:m:FC_TargetPath is an unknown/unprocessed attribued
  Warning: Title.Name:m:FC_ContentKind is an unknown/unprocessed attribued
  Warning: Title.Name:m:FC_KeepInContent is an unknown/unprocessed attribued
  Warning: Title.Synopsis:m:FC_TargetPath is an unknown/unprocessed attribued
  Warning: Title.Synopsis:m:FC_ContentKind is an unknown/unprocessed attribued
  Warning: Title.Synopsis:m:FC_KeepInContent is an unknown/unprocessed attribued
  Warning: Title.DateModified:m:FC_TargetPath is an unknown/unprocessed attribued
  Warning: Title.DateModified:m:FC_ContentKind is an unknown/unprocessed attribued
  Warning: Title.DateModified:m:FC_KeepInContent is an unknown/unprocessed attribued
  Warning: inverseProperty other side missing: Netflix.Catalog.v2.Title_Disc
  Warning: inverseProperty other side missing: Netflix.Catalog.v2.Title_Season
  Warning: inverseProperty other side missing: Netflix.Catalog.v2.Title_Series
  Warning: inverseProperty other side missing: Netflix.Catalog.v2.Title_Movie
Info: generating type Netflix.Catalog.v2.DeliveryFormatAvailability
Info: generating type Netflix.Catalog.v2.BoxArt
Info: generating type Netflix.Catalog.v2.InstantAvailability
Info: generating type Netflix.Catalog.v2.TitleAudioFormat
Info: generating type Netflix.Catalog.v2.TitleAward
Info: generating type Netflix.Catalog.v2.Person
  Warning: Person.Name:m:FC_TargetPath is an unknown/unprocessed attribued
  Warning: Person.Name:m:FC_ContentKind is an unknown/unprocessed attribued
  Warning: Person.Name:m:FC_KeepInContent is an unknown/unprocessed attribued
Info: generating type Netflix.Catalog.v2.TitleScreenFormat
Info: generating type Netflix.Catalog.v2.Language
  Warning: Language.Name:m:FC_TargetPath is an unknown/unprocessed attribued
  Warning: Language.Name:m:FC_ContentKind is an unknown/unprocessed attribued
  Warning: Language.Name:m:FC_KeepInContent is an unknown/unprocessed attribued

When running the tool for 2 all looks good, but the in the generated JavaScript file the entity information for Personand Companyis missing.

////////////////////////////////////////////////////////////////////////////////////////
////// Autogenerated - do not modify or be prepared
////////////////////////////////////

(function(global, $data, undefined) {




  function registerEdmTypes() {

    function Edm_Boolean() { };
    $data.Container.registerType('Edm.Boolean', Edm_Boolean);
    $data.Container.mapType(Edm_Boolean, $data.Boolean);

    function Edm_Binary() { };
    $data.Container.registerType('Edm.Binary', Edm_Binary);
    $data.Container.mapType(Edm_Binary, $data.Blob);

    function Edm_DateTime() { };
    $data.Container.registerType('Edm.DateTime', Edm_DateTime);
    $data.Container.mapType(Edm_DateTime, $data.Date);

    function Edm_DateTimeOffset() { };
    $data.Container.registerType('Edm.DateTimeOffset', Edm_DateTimeOffset);
    $data.Container.mapType(Edm_DateTimeOffset, $data.Integer);

    function Edm_Time() { };
    $data.Container.registerType('Edm.Time', Edm_Time);
    $data.Container.mapType(Edm_Time, $data.Integer);

    function Edm_Decimal() { };
    $data.Container.registerType('Edm.Decimal', Edm_Decimal);
    $data.Container.mapType(Edm_Decimal, $data.Number);

    function Edm_Single() { };
    $data.Container.registerType('Edm.Single', Edm_Single);
    $data.Container.mapType(Edm_Single, $data.Number);

    function Edm_Double() { };
    $data.Container.registerType('Edm.Double', Edm_Double);
    $data.Container.mapType(Edm_Double, $data.Number);

    function Edm_Guid() { };
    $data.Container.registerType('Edm.Guid', Edm_Guid);
    $data.Container.mapType(Edm_Guid, $data.String);

    function Edm_Int16() { };
    $data.Container.registerType('Edm.Int16', Edm_Int16);
    $data.Container.mapType(Edm_Int16, $data.Integer);

    function Edm_Int32() { };
    $data.Container.registerType('Edm.Int32', Edm_Int32);
    $data.Container.mapType(Edm_Int32, $data.Integer);

    function Edm_Int64() { };
    $data.Container.registerType('Edm.Int64', Edm_Int64);
    $data.Container.mapType(Edm_Int64, $data.Integer);

    function Edm_Byte() { };
    $data.Container.registerType('Edm.Byte', Edm_Byte);
    $data.Container.mapType(Edm_Byte, $data.Integer);

    function Edm_String() { };
    $data.Container.registerType('Edm.String', Edm_String);
    $data.Container.mapType(Edm_String, $data.String);

  };
  registerEdmTypes();


  })(window, $data);

Not sure if I'm doing something wrong here or if that would is expected for the RC1 version.

Every feedback welcome,

Rainer

JaySvcUtil fails to generate context definition to Bing service

The developer tried to use JaySvcUtil to generate context definition of the following Bing service:
https://api.datamarket.azure.com/Bing/SearchWeb/$metadata

The tool fails with error message.

The problem is caused by the possibility of a secondary XML namespace of OData v2.
http://msdn.microsoft.com/en-us/library/microsoft.data.edm.library.edmconstants(v=vs.103).aspx

JaySvcUtil should recognize http://schemas.microsoft.com/ado/2009/08/edm as a OData v2 service.

Regular Expression Parse Error on SqLiteProvider.js

JayData: 1.1.1
Android: 2.3.4

The first time the application executes fine. But the second time, it throws a javascript error and hangs. We track the error to a database creation strategy.

Basically, the RegEx.exec(...) javascript function was returning "null", not matter if the regular expression was right. It must be an Android bug, but we had to fix it to make it work on the actual Android device.

Until now, we didn't notice, because we were developing and testing in Chrome.

So, to fix the error we changed the .exec() function by the .match() function. This way, the provider works well on desktop Chrome and the Android device.

Hope this can help. By the way, is there a roadmap or some information about the next stable release?

Thanks and keep up the good work!

SqLiteProvider.js:619

@@ -614,12 +614,12 @@ $data.Class.define('$data.dbClient.DbCommand', null, null,
                             var data = regEx.exec(that.SqlCommands[i]);
                             if (data) {
                                 var tableName = data[1];
                                 var tableDef = data[2];
                                 if (existObjectInDB[tableName.slice(1, tableName.length - 1)]) {
-                                    var existsRegEx = /^CREATE TABLE ([^ ]*) (\(.*\))/g;
-                                    var existTableDef = existsRegEx.exec(existObjectInDB[tableName.slice(1, tableName.length - 1)].sql)[2];
+                                    var existsRegExMatches = existObjectInDB[tableName.slice(1, tableName.length - 1)].sql.match(/\([\s\S]*\)/g);
+                                   var existTableDef = existsRegExMatches[0];
                                     if (tableDef.toLowerCase() != existTableDef.toLowerCase()) {
                                         deleteCmd.push("DROP TABLE IF EXISTS [" + existObjectInDB[tableName.slice(1, tableName.length - 1)].tbl_name + "];");
                                     }
                                 }
                             }

Known Issue: $data.Class.define must throw error when base type is undefined

This code is faulty, it has $data.Entity instead of $data.types.Entity. However it still runs without error or any indication of a problem.

$data.Class.define("$org.Types.Department", $data.Entity, null, {
Id: { dataType: "int", key: true, computed: true },
Name: { dataType: "string" },
Address: { dataType: "string" },
Employee: { dataType: "Array", elementType: "$org.Types.Employee", navigationProperty: "Department" }
}, null);

Sencha Touch 2 plugin

The data management is supported very well. Developers could implement hybrid applications faster with a JayData extension, which helps the bindig of JayData query results to Sencha Touch 2 user interface elements.

Support for PATCH instead of MERGE in Odata 3.0

At OData it states

http://www.odata.org/blog/2012/5/11/odata-v3-demo-services

You can send PATCH requests instead of MERGE. The behavior is identical otherwise.

but in the preliminary SharePoint 2013 docs it states

http://msdn.microsoft.com/en-us/library/fp142386(v=office.15).aspx

Although the SharePoint REST service supports MERGE requests for backward compatibility reasons, we recommend you use PATCH requests instead.

Are you going to support this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.