Package com.adaptrex.core.ext

Examples of com.adaptrex.core.ext.ModelDefinition


    String fullModelName = namespace +  ".model." + modelName;
   
    /*
     * Get the model definition
     */
    ModelDefinition modelDefinition = new ModelDefinition(this.extConfig);
   
    /*
     * Add the rest API to the model
     */
    modelDefinition.setProxy(this.restProxy);
   
    if (request.getAttribute("adaptrex_touch") == null) {
      modelDefinitionStrings.add("Ext.define('" + fullModelName + "', " +
          StringUtilities.json(modelDefinition) + ")");
    } else {
      modelDefinitionStrings.add("Ext.define('" + fullModelName + "', {extend:'Ext.data.Model', config:" +
          StringUtilities.json(modelDefinition) + "})");
    }
   
   
    /*
     * Get the model's association definitions
     */
    getAllAssociations(modelDefinition);
    for (Association association : associations) {
      ModelDefinition assocModelDef = association.getModelDefinition();
      if (assocModelDef != null) {
        if (request.getAttribute("adaptrex_touch") == null) {
          modelDefinitionStrings.add("Ext.define('" + assocModelDef.getModelName() + "', " +
              StringUtilities.json(assocModelDef) + ")");
        } else {
          modelDefinitionStrings.add("Ext.define('" + assocModelDef.getModelName() + "', {extend:'Ext.data.Model', config:" +
              StringUtilities.json(assocModelDef) + "})");       
        }
      }
    }
   
View Full Code Here


    String fullModelName = namespace +  ".model." + modelName;
   
    /*
     * Get the model definition
     */
    ModelDefinition modelDefinition = new ModelDefinition(this.extConfig);
   
    /*
     * Add the rest API to the model
     */
    modelDefinition.setProxy(this.restProxy);
   
    if (request.getAttribute("adaptrex_touch") == null) {
      modelDefinitionStrings.add("Ext.define('" + fullModelName + "', " +
          StringUtilities.json(modelDefinition) + ")");
    } else {
      modelDefinitionStrings.add("Ext.define('" + fullModelName + "', {extend:'Ext.data.Model', config:" +
          StringUtilities.json(modelDefinition) + "})");
    }
   
   
    /*
     * Get the model's association definitions
     */
    getAllAssociations(modelDefinition);
    for (Association association : associations) {
      ModelDefinition assocModelDef = association.getModelDefinition();
      if (assocModelDef != null) {
        if (request.getAttribute("adaptrex_touch") == null) {
          modelDefinitionStrings.add("Ext.define('" + assocModelDef.getModelName() + "', " +
              StringUtilities.json(assocModelDef) + ")");
        } else {
          modelDefinitionStrings.add("Ext.define('" + assocModelDef.getModelName() + "', {extend:'Ext.data.Model', config:" +
              StringUtilities.json(assocModelDef) + "})");       
        }
      }
    }
   
View Full Code Here

    String fullModelName = namespace +  ".model." + modelName;
   
    /*
     * Get the model definition
     */
    ModelDefinition modelDefinition = new ModelDefinition(this.extConfig);
   
    /*
     * Add the rest API to the model
     */
    modelDefinition.setProxy(this.restProxy);
   
    if (request.getAttribute("adaptrex_touch") == null) {
      modelDefinitionStrings.add("Ext.define('" + fullModelName + "', " +
          StringUtilities.json(modelDefinition) + ")");
    } else {
      modelDefinitionStrings.add("Ext.define('" + fullModelName + "', {extend:'Ext.data.Model', config:" +
          StringUtilities.json(modelDefinition) + "})");
    }
   
   
    /*
     * Get the model's association definitions
     */
    getAllAssociations(modelDefinition);
    for (Association association : associations) {
      ModelDefinition assocModelDef = association.getModelDefinition();
      if (assocModelDef != null) {
        if (request.getAttribute("adaptrex_touch") == null) {
          modelDefinitionStrings.add("Ext.define('" + assocModelDef.getModelName() + "', " +
              StringUtilities.json(assocModelDef) + ")");
        } else {
          modelDefinitionStrings.add("Ext.define('" + assocModelDef.getModelName() + "', {extend:'Ext.data.Model', config:" +
              StringUtilities.json(assocModelDef) + "})");       
        }
      }
    }
   
View Full Code Here

   
    /*
     * Get the model definition
     */
    log.debug("Creating model definition for " + fullModelName);
    ModelDefinition modelDefinition = new ModelDefinition(this.extConfig);
   
    /*
     * Add the rest API to the model
     */
    modelDefinition.setProxy(this.restProxy);
    modelDefinitionStrings.add("Ext.define('" + fullModelName + "', " +
        (isTouch ? "{extend:'Ext.data.Model', config:" : "") +
        StringUtilities.json(modelDefinition, this.request.getServletContext()) + (isTouch ? "}" : "") + ");\n");
   
   
    /*
     * Get the model's association definitions
     */
    getAllAssociations(modelDefinition);
    for (Association association : associations) {
      ModelDefinition assocModelDef = association.getModelDefinition();
      if (assocModelDef != null) {
        /*
         * If we have a rest proxy for the parent model, add one for associated models
         */
        if (this.restProxy != null) {
          String restPath = getRestPath(association.getEntityClassName().toLowerCase());
          if (!restPath.equals("false")) {
            RestProxy associatedProxy = new RestProxy(restPath, extConfig, this.configComponent.isTouch());
            assocModelDef.setProxy(associatedProxy);
          }
         
        }

        modelDefinitionStrings.add("Ext.define('" + assocModelDef.getModelName() + "', " +
            (isTouch ? "{extend:'Ext.data.Model', config:" : "") +
            StringUtilities.json(assocModelDef, this.request.getServletContext()) + (isTouch ? "}" : "") + ");\n");
      }
    }
   
View Full Code Here

   
    /*
     * Get the model definition
     */
    log.debug("Creating model definition for " + fullModelName);
    ModelDefinition modelDefinition = new ModelDefinition(this.extConfig);
   
    /*
     * Add the rest API to the model
     */
    modelDefinition.setProxy(this.restProxy);
    modelDefinitionStrings.add("Ext.define('" + fullModelName + "', " +
        (isTouch ? "{extend:'Ext.data.Model', config:" : "") +
        StringUtilities.json(modelDefinition, this.request.getServletContext()) + (isTouch ? "}" : "") + ");\n");
   
   
    /*
     * Get the model's association definitions
     */
    getAllAssociations(modelDefinition);
    for (Association association : associations) {
      ModelDefinition assocModelDef = association.getModelDefinition();
      if (assocModelDef != null) {
        /*
         * If we have a rest proxy for the parent model, add one for associated models
         */
        if (this.restProxy != null) {
          String restPath = getRestPath(association.getEntityClassName().toLowerCase());
          if (!restPath.equals("false")) {
            RestProxy associatedProxy = new RestProxy(restPath, extConfig, this.configComponent.isTouch());
            assocModelDef.setProxy(associatedProxy);
          }
         
        }

        modelDefinitionStrings.add("Ext.define('" + assocModelDef.getModelName() + "', " +
            (isTouch ? "{extend:'Ext.data.Model', config:" : "") +
            StringUtilities.json(assocModelDef, this.request.getServletContext()) + (isTouch ? "}" : "") + ");\n");
      }
    }
   
View Full Code Here

TOP

Related Classes of com.adaptrex.core.ext.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.