lib/DefaultDataHandler.js
function saveSchemas(app) {
    var keys = Object.keys(DependenciesMap);
    if (keys.length == 0) {
        _l('Default data saved...');
        event.emit(COMPLETED_EVENT);
        return;
    }
    HandlerArray = [];
    var errFlag = true;
    keys.forEach(function (k) {
        dependenciesExists(k) && HandlerArray.push(getHandler(app, k, PluginsData[k]));

    });
    async.series(HandlerArray, function (err, end) {
        if (err)
            throw err;

        saveSchemas(app);
    });
}
function saveSchemas(app) {
    var keys = Object.keys(DependenciesMap);
    if (keys.length == 0) {
        _l('Default data saved...');
        event.emit(COMPLETED_EVENT);
        return;
    }
    HandlerArray = [];
    var errFlag = true;
    keys.forEach(function (k) {
        dependenciesExists(k) && HandlerArray.push(getHandler(app, k, PluginsData[k]));

    });
    async.series(HandlerArray, function (err, end) {
        if (err)
            throw err;

        saveSchemas(app);
    });
}
function saveSchemas ( app ) { var keys = Object . keys ( DependenciesMap ) ; if ( keys . length == 0 ) { _l ( 'Default data saved...' ) ; event . emit ( COMPLETED_EVENT ) ; return ; } HandlerArray = [ ] ; var errFlag = true ; keys . forEach ( function ( k ) { dependenciesExists ( k ) && HandlerArray . push ( getHandler ( app , k , PluginsData [ k ] ) ) ; } ) ; async . series ( HandlerArray , function ( err , end ) { if ( err ) throw err ; saveSchemas ( app ) ; } ) ; }
Saves those schemas which depends on other collections data.
@param app
Saves those schemas which depends on other collections data .