Package com.adaptrex.core.ext.data

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


    /*
     * Create the model
     */
    AdaptrexSession session = new AdaptrexSession(persistence);
    Model model = new Model(session, config);

    /*
     * Set the model name
     */
    String modelName = namespace + ".model."
        + (name != null ? name : className);
    config.setModelName(name);

    if (include != null) {
      config.include(include);
    }
    if (exclude != null) {
      config.exclude(exclude);
    }

    /*
     * Add associations
     */
    if (associations != null) {
      config.associations(associations);
    }

    /*
     * The proxy needs additinoal information from the model. We shouldn't
     * create the proxy until the store has been fully configured
     */
    if (rest != null) {
      String restPath = getRequest().getContextPath()
          + "/rest/"
          + (rest.equals("true") ? clazz.getSimpleName()
              .toLowerCase() : rest);
      config.setProxy(new RestProxy(restPath, config));
    }

    /*
     * 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
View Full Code Here


  /*
   * Create the model
   */
  AdaptrexSession session = new AdaptrexSession(persistence);
  Model model = new Model(session, config);

 
  /*
   * Set the model name
   */
  String modelName = ns + ".model." + (name != null ? name : className);
  config.setModelName(name);


  if (include != null) {
      config.include(include);
  }
  if (exclude != null) {
      config.exclude(exclude);
  }

  /*
   * Add associations
   */
  if (associations != null) {
      config.associations(associations);
  }

  /*
   * The proxy needs additinoal information from the model.  We shouldn't create
   * the proxy until the store has been fully configured
   */
  if (rest != null) {
      String restPath = getRequest().getContextPath() + "/rest/" +
      (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) {
View Full Code Here

      }
     
      /*
       * Create the model
       */
      Model model = new Model(className, ns);
      if (name != null) model.modelName(name);
     
      if (include != null) model.include(include);
      if (exclude != null) model.exclude(exclude);
     
      /*
       * Add associations
       */
      if (associations != null) model.associations(associations);
     
      /*
       * The proxy needs additinoal information from the model.  We shouldn't create
       * the proxy until the store has been fully configured
       */
      if (rest != null) {
        String restPath = getRequest().getContextPath() + "/rest/";
        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;
View Full Code Here

      }
     
      /*
       * Create the model
       */
      Model model = new Model(className, ns);
      if (name != null) model.modelName(name);
     
      if (include != null) model.include(include);
      if (exclude != null) model.exclude(exclude);
     
      /*
       * Add associations
       */
      if (associations != null) model.associations(associations);
     
      /*
       * The proxy needs additinoal information from the model.  We shouldn't create
       * the proxy until the store has been fully configured
       */
      if (rest != null) {
        String restPath = getRequest().getContextPath() + "/rest/";
        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;
View Full Code Here

  /*
   * Create the model
   */
  AdaptrexSession session = new AdaptrexSession(persistence);
  Model model = new Model(session, config);

 
  /*
   * Set the model name
   */
  String modelName = namespace + ".model." + (name != null ? name : className);
  config.setModelName(name);


  if (include != null) {
      config.include(include);
  }
  if (exclude != null) {
      config.exclude(exclude);
  }

  /*
   * Add associations
   */
  if (associations != null) {
      config.associations(associations);
  }

  /*
   * The proxy needs additinoal information from the model.  We shouldn't create
   * the proxy until the store has been fully configured
   */
  if (rest != null) {
      String restPath = getRequest().getContextPath() + "/rest/" +
      (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) {
View Full Code Here

TOP

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

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.