Package com.adaptrex.core.ext.data

Examples of com.adaptrex.core.ext.data.ModelDefinition


    /*
     * TODO: Make sure we're outputting our model definition in the same way
     * as in the store
     */
    ModelDefinition modelDef = model.getModelDefinition();
    String output = "Ext.define(\"" + modelName + "\","
        + StringUtilities.json(modelDef) + ");\n";

    for (Association assoc : getAllAssociations(modelDef)) {
      ModelDefinition associatedModel = assoc
          .getAssociatedModelDefinition();
      if (associatedModel == null) {
        continue;
      }

View Full Code Here


        config.setProxy(new RestProxy(restPath, config));
      }


      StoreDefinition storeDefinition = store.getStoreDefinition();
      ModelDefinition baseModelDefinition = store.getModelDefinition();

      /*
       * Write the javascript for this store/model.
       *
       * During development using Ext.Loader, we need to syncRequire Ext.data.Model.
       * If we asynchronously load all of our model's dependencies, they will not be
       * available at the time we define our store.  If they are not available, our
       * model definition will not yet be instantiated and Ext.Loader will attempt (and fail)
       * to load it dynamically.
       */
      String extBuild = param(a, AdaptrexConfig.EXT_BUILD);
      if (extBuild == null) extBuild = Adaptrex.getAdaptrex().getConfig().get(AdaptrexConfig.EXT_BUILD, "production")
     
      String storeName = namespace + ".store." + StringUtilities.pluralize(config.getSimpleModelName());
     
      /*
       * Build the output javascript
       */
      String output = "Ext.define(\"" + modelName + "\"," + StringUtilities.json(baseModelDefinition) + ");\n"
          + "Ext.define(\"" + storeName + "\"," + StringUtilities.json(storeDefinition) + ");\n";

      for (Association assoc : getAllAssociations(baseModelDefinition)) {
        ModelDefinition associatedModel = assoc.getAssociatedModelDefinition();
        if (associatedModel == null) {
          continue;
        }

        output += "Ext.define(\"" + assoc.getModelName() + "\"," + StringUtilities.json(associatedModel) + ");\n";
View Full Code Here

      (rest.equals("true") ? clazz.getSimpleName().toLowerCase() : rest);
      config.setProxy(new RestProxy(restPath, config));
  }


  ModelDefinition modelDef = model.getModelDefinition();
  String output = "Ext.define(\"" + modelName + "\"," + StringUtilities.json(modelDef) + ");\n";

  for (Association assoc : getAllAssociations(modelDef)) {
      ModelDefinition associatedModel = assoc.getAssociatedModelDefinition();
      if (associatedModel == null) {
    continue;
      }

      output += "Ext.define(\"" + assoc.getModelName() + "\"," + StringUtilities.json(associatedModel) + ");\n";
View Full Code Here

        config.setProxy(new RestProxy(restPath, config));
      }


      StoreDefinition storeDefinition = store.getStoreDefinition();
      ModelDefinition baseModelDefinition = store.getModelDefinition();

      /*
       * Write the javascript for this store/model.
       *
       * During development using Ext.Loader, we need to syncRequire Ext.data.Model.
       * If we asynchronously load all of our model's dependencies, they will not be
       * available at the time we define our store.  If they are not available, our
       * model definition will not yet be instantiated and Ext.Loader will attempt (and fail)
       * to load it dynamically.
       */
      String storeName = ns + ".store." + StringUtilities.pluralize(config.getSimpleModelName());
      String output = ""
          + "Ext.syncRequire(['Ext.data.Model','Ext.data.Store','Ext.data.reader.Json','Ext.data.writer.Json'], function(){;\n"
          + "Ext.define(\"" + modelName + "\"," + StringUtilities.json(baseModelDefinition) + ");\n"
          + "Ext.define(\"" + storeName + "\"," + StringUtilities.json(storeDefinition) + ");\n"
          + "Ext.onReady(function() {Ext.create(\"" + storeName + "\", {storeId:\"" + storeName.split(".store.")[1] + "\"})})\n";


      for (Association assoc : getAllAssociations(baseModelDefinition)) {
        ModelDefinition associatedModel = assoc.getAssociatedModelDefinition();
        if (associatedModel == null) {
          continue;
        }

        output += "Ext.define(\"" + assoc.getModelName() + "\"," + StringUtilities.json(associatedModel) + ");\n";
View Full Code Here

        restPath += (rest.equals("true") ? model.getConfig().getClazz().getSimpleName().toLowerCase() : rest);
        model.proxy(restPath);
      }
     
     
      ModelDefinition modelDef = model.getModelDefinition();
      String modelName = ns + ".model." + model.getConfig().getModelName();
      String output =  "Ext.define(\"" + modelName + "\"," + StringUtilities.json(modelDef) + ");\n";

        for (Association assoc : getAllAssociations(modelDef)) {
          ModelDefinition associatedModel = assoc.getAssociatedModelDefinition();
          if (associatedModel == null) continue;
         
          output += "Ext.define(\"" + assoc.getModelName() + "\"," + StringUtilities.json(associatedModel) + ");\n";
        }
       
View Full Code Here

        }
       
       
       
        StoreDefinition storeDefinition = store.getStoreDefinition();
        ModelDefinition baseModelDefinition = store.getModelDefinition();
       
        /*
         * Write the javascript for this store/model.
         *
         * During development using Ext.Loader, we need to syncRequire Ext.data.Model.
         * If we asynchronously load all of our model's dependencies, they will not be
         * available at the time we define our store.  If they are not available, our
         * model definition will not yet be instantiated and Ext.Loader will attempt (and fail)
         * to load it dynamically.
         */
        String storeModelName = store.getConfig().getModelName();
        String storeName = ns + ".store." + StringUtilities.pluralize(storeModelName);
        String modelName = ns + ".model." + storeModelName;
        String output =
          "Ext.syncRequire('Ext.data.Model');\n" +
          "Ext.define(\"" + modelName + "\"," + StringUtilities.json(baseModelDefinition) + ");\n" +
        "Ext.define(\"" + storeName + "\"," + StringUtilities.json(storeDefinition) + ");\n";

        for (Association assoc : getAllAssociations(baseModelDefinition)) {
          ModelDefinition associatedModel = assoc.getAssociatedModelDefinition();
          if (associatedModel == null) continue;
         
          output += "Ext.define(\"" + assoc.getModelName() + "\"," + StringUtilities.json(associatedModel) + ");\n";
        }
       
View Full Code Here

        }
       
       
       
        StoreDefinition storeDefinition = store.getStoreDefinition();
        ModelDefinition baseModelDefinition = store.getModelDefinition();
       
        /*
         * Write the javascript for this store/model.
         *
         * During development using Ext.Loader, we need to syncRequire Ext.data.Model.
         * If we asynchronously load all of our model's dependencies, they will not be
         * available at the time we define our store.  If they are not available, our
         * model definition will not yet be instantiated and Ext.Loader will attempt (and fail)
         * to load it dynamically.
         */
        String storeModelName = store.getConfig().getModelName();
        String storeName = ns + ".store." + StringUtilities.pluralize(storeModelName);
        String modelName = ns + ".model." + storeModelName;
        String output =
          "Ext.syncRequire('Ext.data.Model');\n" +
          "Ext.define(\"" + modelName + "\"," + StringUtilities.json(baseModelDefinition) + ");\n" +
        "Ext.define(\"" + storeName + "\"," + StringUtilities.json(storeDefinition) + ");\n";

        for (Association assoc : getAllAssociations(baseModelDefinition)) {
          ModelDefinition associatedModel = assoc.getAssociatedModelDefinition();
          if (associatedModel == null) continue;
         
          output += "Ext.define(\"" + assoc.getModelName() + "\"," + StringUtilities.json(associatedModel) + ");\n";
        }
       
View Full Code Here

        restPath += (rest.equals("true") ? model.getConfig().getClazz().getSimpleName().toLowerCase() : rest);
        model.proxy(restPath);
      }
     
     
      ModelDefinition modelDef = model.getModelDefinition();
      String modelName = ns + ".model." + model.getConfig().getModelName();
      String output =  "Ext.define(\"" + modelName + "\"," + StringUtilities.json(modelDef) + ");\n";

        for (Association assoc : getAllAssociations(modelDef)) {
          ModelDefinition associatedModel = assoc.getAssociatedModelDefinition();
          if (associatedModel == null) continue;
         
          output += "Ext.define(\"" + assoc.getModelName() + "\"," + StringUtilities.json(associatedModel) + ");\n";
        }
       
View Full Code Here

      (rest.equals("true") ? clazz.getSimpleName().toLowerCase() : rest);
      config.setProxy(new RestProxy(restPath, config));
  }


  ModelDefinition modelDef = model.getModelDefinition();
  String output = "Ext.define(\"" + modelName + "\"," + StringUtilities.json(modelDef) + ");\n";

  for (Association assoc : getAllAssociations(modelDef)) {
      ModelDefinition associatedModel = assoc.getAssociatedModelDefinition();
      if (associatedModel == null) {
    continue;
      }

      output += "Ext.define(\"" + assoc.getModelName() + "\"," + StringUtilities.json(associatedModel) + ");\n";
View Full Code Here

        config.setProxy(new RestProxy(restPath, config));
      }


      StoreDefinition storeDefinition = store.getStoreDefinition();
      ModelDefinition baseModelDefinition = store.getModelDefinition();

      /*
       * Write the javascript for this store/model.
       *
       * During development using Ext.Loader, we need to syncRequire Ext.data.Model.
       * If we asynchronously load all of our model's dependencies, they will not be
       * available at the time we define our store.  If they are not available, our
       * model definition will not yet be instantiated and Ext.Loader will attempt (and fail)
       * to load it dynamically.
       */
      String storeName = namespace + ".store." + StringUtilities.pluralize(config.getSimpleModelName());
      String output = ""
          + "Ext.syncRequire(['Ext.data.Model','Ext.data.Store','Ext.data.reader.Json','Ext.data.writer.Json'], function(){;\n"
          + "Ext.define(\"" + modelName + "\"," + StringUtilities.json(baseModelDefinition) + ");\n"
          + "Ext.define(\"" + storeName + "\"," + StringUtilities.json(storeDefinition) + ");\n"
          + "Ext.onReady(function() {Ext.create(\"" + storeName + "\", {storeId:\"" + storeName.split(".store.")[1] + "\"})})\n";


      for (Association assoc : getAllAssociations(baseModelDefinition)) {
        ModelDefinition associatedModel = assoc.getAssociatedModelDefinition();
        if (associatedModel == null) {
          continue;
        }

        output += "Ext.define(\"" + assoc.getModelName() + "\"," + StringUtilities.json(associatedModel) + ");\n";
View Full Code Here

TOP

Related Classes of com.adaptrex.core.ext.data.ModelDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.