How to use ember-flexberry-data - 10 common examples

To help you get started, we’ve selected a few ember-flexberry-data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Flexberry / ember-flexberry-designer / addon / utils / fd-preload-stage-metadata.js View on Github external
all(promises).then(() => {
      let readonlyModeService = getOwner(store).lookup('service:fd-readonly-mode-service');
      if (readonlyModeService.getReadonlyModeProject()) {
        return resolve();
      }

      let userService = getOwner(store).lookup('service:user');
      let userName = userService.getCurrentUserName();
      let lockModelName = 'new-platform-flexberry-services-lock';

      let lockPredicate = new SimplePredicate('userName', FilterOperator.Eq, userName);
      let q = new Builder(store, lockModelName)
        .selectByProjection('LockL')
        .where(lockPredicate)
        .build();

      // delete locks for objects in current stage for current user.
      store.query(lockModelName, q).then((lockObjects) => {
        let deleteLocksPromises = [];
        lockObjects.forEach((item) => {
          let needToDeleteLock = tryPeekRecord(store, 'fd-dev-class', item.get('id'), stagePk) ||
            tryPeekRecord(store, 'fd-dev-association', item.get('id'), stagePk) ||
            tryPeekRecord(store, 'fd-dev-aggregation', item.get('id'), stagePk) ||
            tryPeekRecord(store, 'fd-dev-inheritance', item.get('id'), stagePk);

          if (needToDeleteLock) {
            deleteLocksPromises.push(item.destroyRecord());
github Flexberry / ember-flexberry-designer / addon / routes / fd-association-list-form.js View on Github external
objectListViewLimitPredicate() {
    // Demo data  TODO: Demo mode.
    let demoStage = 'FB6972D1-F04A-4617-B454-D2D0DB4CEC05';
    let stagePk = this.get('currentProjectContext').getCurrentStage();
    let simplePredicates = Ember.A();
    if (stagePk.toLocaleLowerCase()  === demoStage.toLocaleLowerCase()) {
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '5b6bd5cd-66f2-4c38-85d1-9b0633df17b9'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '83daf0b0-a6df-4298-8980-1325b5c4ad09'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, 'a58fcb63-69dd-4003-a7d1-17795568b3ce'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '91b136b8-ba32-43e7-aaf7-ac01c809d67c'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '1594c7c7-ea8f-46ea-a137-277258548945'));
      return new Query.ComplexPredicate(Query.Condition.Or, ...simplePredicates);
    }

    return;
  },
});
github Flexberry / ember-flexberry-designer / addon / routes / fd-association-list-form.js View on Github external
objectListViewLimitPredicate() {
    // Demo data  TODO: Demo mode.
    let demoStage = 'FB6972D1-F04A-4617-B454-D2D0DB4CEC05';
    let stagePk = this.get('currentProjectContext').getCurrentStage();
    let simplePredicates = Ember.A();
    if (stagePk.toLocaleLowerCase()  === demoStage.toLocaleLowerCase()) {
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '5b6bd5cd-66f2-4c38-85d1-9b0633df17b9'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '83daf0b0-a6df-4298-8980-1325b5c4ad09'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, 'a58fcb63-69dd-4003-a7d1-17795568b3ce'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '91b136b8-ba32-43e7-aaf7-ac01c809d67c'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '1594c7c7-ea8f-46ea-a137-277258548945'));
      return new Query.ComplexPredicate(Query.Condition.Or, ...simplePredicates);
    }

    return;
  },
});
github Flexberry / ember-flexberry-designer / addon / routes / fd-association-list-form.js View on Github external
objectListViewLimitPredicate() {
    // Demo data  TODO: Demo mode.
    let demoStage = 'FB6972D1-F04A-4617-B454-D2D0DB4CEC05';
    let stagePk = this.get('currentProjectContext').getCurrentStage();
    let simplePredicates = Ember.A();
    if (stagePk.toLocaleLowerCase()  === demoStage.toLocaleLowerCase()) {
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '5b6bd5cd-66f2-4c38-85d1-9b0633df17b9'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '83daf0b0-a6df-4298-8980-1325b5c4ad09'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, 'a58fcb63-69dd-4003-a7d1-17795568b3ce'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '91b136b8-ba32-43e7-aaf7-ac01c809d67c'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '1594c7c7-ea8f-46ea-a137-277258548945'));
      return new Query.ComplexPredicate(Query.Condition.Or, ...simplePredicates);
    }

    return;
  },
});
github Flexberry / ember-flexberry-designer / addon / routes / fd-association-list-form.js View on Github external
objectListViewLimitPredicate() {
    // Demo data  TODO: Demo mode.
    let demoStage = 'FB6972D1-F04A-4617-B454-D2D0DB4CEC05';
    let stagePk = this.get('currentProjectContext').getCurrentStage();
    let simplePredicates = Ember.A();
    if (stagePk.toLocaleLowerCase()  === demoStage.toLocaleLowerCase()) {
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '5b6bd5cd-66f2-4c38-85d1-9b0633df17b9'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '83daf0b0-a6df-4298-8980-1325b5c4ad09'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, 'a58fcb63-69dd-4003-a7d1-17795568b3ce'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '91b136b8-ba32-43e7-aaf7-ac01c809d67c'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '1594c7c7-ea8f-46ea-a137-277258548945'));
      return new Query.ComplexPredicate(Query.Condition.Or, ...simplePredicates);
    }

    return;
  },
});
github Flexberry / ember-flexberry-designer / addon / routes / fd-association-list-form.js View on Github external
objectListViewLimitPredicate() {
    // Demo data  TODO: Demo mode.
    let demoStage = 'FB6972D1-F04A-4617-B454-D2D0DB4CEC05';
    let stagePk = this.get('currentProjectContext').getCurrentStage();
    let simplePredicates = Ember.A();
    if (stagePk.toLocaleLowerCase()  === demoStage.toLocaleLowerCase()) {
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '5b6bd5cd-66f2-4c38-85d1-9b0633df17b9'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '83daf0b0-a6df-4298-8980-1325b5c4ad09'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, 'a58fcb63-69dd-4003-a7d1-17795568b3ce'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '91b136b8-ba32-43e7-aaf7-ac01c809d67c'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '1594c7c7-ea8f-46ea-a137-277258548945'));
      return new Query.ComplexPredicate(Query.Condition.Or, ...simplePredicates);
    }

    return;
  },
});
github Flexberry / ember-flexberry-designer / addon / routes / fd-association-list-form.js View on Github external
objectListViewLimitPredicate() {
    // Demo data  TODO: Demo mode.
    let demoStage = 'FB6972D1-F04A-4617-B454-D2D0DB4CEC05';
    let stagePk = this.get('currentProjectContext').getCurrentStage();
    let simplePredicates = Ember.A();
    if (stagePk.toLocaleLowerCase()  === demoStage.toLocaleLowerCase()) {
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '5b6bd5cd-66f2-4c38-85d1-9b0633df17b9'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '83daf0b0-a6df-4298-8980-1325b5c4ad09'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, 'a58fcb63-69dd-4003-a7d1-17795568b3ce'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '91b136b8-ba32-43e7-aaf7-ac01c809d67c'));
      simplePredicates.pushObject(new Query.SimplePredicate('startClass.id', Query.FilterOperator.Eq, '1594c7c7-ea8f-46ea-a137-277258548945'));
      return new Query.ComplexPredicate(Query.Condition.Or, ...simplePredicates);
    }

    return;
  },
});
github Flexberry / ember-flexberry-designer / tests / dummy / app / routes / application.js View on Github external
activate: function() {
    let context = this.get('currentProjectContext');

    if (context.singleStageMode) {
      let store = this.get('store');
      let modelName = 'fd-dev-stage';

      let predicate = new SimplePredicate('id', FilterOperator.Eq, context.context.stage);

      let builder = new Builder(store)
      .from(modelName)
      .select('id,name,configuration.id')
      .where(predicate);

      this.get('appState').loading();
      store.query(modelName, builder.build()).then((result) => {
        if (result && result.get('length') !== undefined && result.get('length') === 1) {
          let stage = result.objectAt(0);
          context.setCurrentConfiguration(stage.get('configuration'));
          context.setCurrentStage(stage);
          FdPreloadStageMetadata.call(this, store, context.getCurrentStage()).then(() =>
            context.getAutogeneratedSystemPromise()).then(() => {
              if (this.get('controller.currentRouteName') === 'fd-appstruct-form') {
                this.refresh();
              } else {
                this.transitionTo('fd-appstruct-form');
github Flexberry / ember-flexberry-designer / tests / dummy / app / routes / application.js View on Github external
activate: function() {
    let context = this.get('currentProjectContext');

    if (context.singleStageMode) {
      let store = this.get('store');
      let modelName = 'fd-dev-stage';

      let predicate = new SimplePredicate('id', FilterOperator.Eq, context.context.stage);

      let builder = new Builder(store)
      .from(modelName)
      .select('id,name,configuration.id')
      .where(predicate);

      this.get('appState').loading();
      store.query(modelName, builder.build()).then((result) => {
        if (result && result.get('length') !== undefined && result.get('length') === 1) {
          let stage = result.objectAt(0);
          context.setCurrentConfiguration(stage.get('configuration'));
          context.setCurrentStage(stage);
          FdPreloadStageMetadata.call(this, store, context.getCurrentStage()).then(() =>
            context.getAutogeneratedSystemPromise()).then(() => {
              if (this.get('controller.currentRouteName') === 'fd-appstruct-form') {
                this.refresh();
github Flexberry / ember-flexberry-designer / addon / mixins / regenerated / models / fd-dev-association.js View on Github external
})
  });
  modelClass.defineProjection('Gen', 'fd-dev-association', {
    pBMasterCustomAttributes: Projection.attr(''),
    pBMasterGetEnd: Projection.attr(''),
    pBMasterGetStart: Projection.attr(''),
    storage: Projection.attr(''),
    autoStoreMasterDisabled: Projection.attr(''),
    typeUsage: Projection.attr(''),
    autoGenerateTypeUsage: Projection.attr(''),
    description: Projection.attr('')
  });
  modelClass.defineProjection('Generator', 'fd-dev-association', {
    assocType: Projection.attr('AssocType', { hidden: true }),
    autoGenerateTypeUsage: Projection.attr('AutoGenerateTypeUsage', { hidden: true }),
    pBMasterCustomAttributes: Projection.attr('PBMasterCustomAttributes', { hidden: true }),
    pBMasterGetEnd: Projection.attr('PBMasterGetEnd', { hidden: true }),
    pBMasterSetEnd: Projection.attr('PBMasterSetEnd', { hidden: true }),
    pBMasterGetStart: Projection.attr('PBMasterGetStart', { hidden: true }),
    pBMasterSetStart: Projection.attr('PBMasterSetStart', { hidden: true }),
    realStorage: Projection.attr('RealStorage', { hidden: true }),
    typeUsage: Projection.attr('TypeUsage', { hidden: true }),
    autoStoreMasterDisabled: Projection.attr('AutoStoreMasterDisabled', { hidden: true }),
    realEndRole: Projection.attr('RealEndRole', { hidden: true }),
    realStartRole: Projection.attr('RealStartRole', { hidden: true }),
    storage: Projection.attr('Storage', { hidden: true }),
    startRolePublishName: Projection.attr('StartRolePublishName', { hidden: true }),
    endRolePublishName: Projection.attr('EndRolePublishName', { hidden: true }),
    endMultiplicity: Projection.attr('EndMultiplicity', { hidden: true }),
    endRole: Projection.attr('EndRole', { hidden: true }),
    endRoleAccessModifier: Projection.attr('EndRoleAccessModifier', { hidden: true }),
    endRoleStored: Projection.attr('EndRoleStored', { hidden: true }),