Skip to content

Instantly share code, notes, and snippets.

@TGOlson
Created November 14, 2014 22:20
Show Gist options
  • Select an option

  • Save TGOlson/0d46ec76d96db794ac32 to your computer and use it in GitHub Desktop.

Select an option

Save TGOlson/0d46ec76d96db794ac32 to your computer and use it in GitHub Desktop.
// place in root launchpad folder
var entityDao = require('./server/services/entity-dao'),
config = require('./server/config/config'),
systemService = require('./server/services/mj-entity-service/mj-entity-service');
entityDao.connect(config.db)
.then(actions)
.fail(onError);
function actions() {
var eid = systemService.makeEid('system', 'tenant-0'),
tenant = systemService.get(eid);
logProps('Before load', tenant);
return tenant.load({type: true}).then(function() {
logProps('After load type', tenant);
return tenant.load({communities: true});
}).then(function() {
logProps('After load community', tenant);
});
}
function logProps(status, tenant) {
console.log(status, tenant.loadedProperties);
}
function onError(err) {
console.error('Junk file error', err.stack || err);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment