Package com.adaptrex.core.ext.data

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


      /*
       * Create the store
       */
      AdaptrexSession session = new AdaptrexSession(persistence);
      Store store = new Store(session, config);


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

      /*
       * If our store doesn't have a class drop out
       */
      if (clazz == null) {
        write("<!-- Error creating store: Could not find entity for " + className + " -->\n");
        return;
      }


      /*
       * Various store options
       */
      if (pageSize != null) {
        config.setPageSize(Integer.valueOf(pageSize));
      }
      if (include != null) {
        config.include(include);
      }
      if (exclude != null) {
        config.exclude(exclude);
      }

      if (clearOnPageLoad != null && clearOnPageLoad.equals("true")) {
        config.setClearOnPageLoad(true);
      }
      if (clearRemovedOnLoad != null && clearRemovedOnLoad.equals("true")) {
        config.setClearRemovedOnLoad(true);
      }
      if (autoSync != null && autoSync.equals("true")) {
        config.setAutoSync(true);
      }
      if (autoLoad != null && autoLoad.equals("true")) {
        config.setAutoLoad(true);
      }
      if (remoteGroup != null && remoteGroup.equals("true")) {
        config.setRemoteGroup(true);
      }
      if (remoteSort != null && remoteSort.equals("true")) {
        config.setRemoteSort(true);
      }
      if (remoteFilter != null && remoteFilter.equals("true")) {
        config.setRemoteFilter(true);
      }
      if (sortOnFilter != null && sortOnFilter.equals("true")) {
        config.setSortOnFilter(true);
      }


      /*
       * Filtering
       */
      if (filter != null) {
        for (String filterItem : filter.split(",")) {
          String[] parts = filterItem.split("=");
          String property = parts[0];
          String value = parts.length > 1 ? parts[1] : null;
          config.filter(property, value);
        }
      }


      /*
       * Grouping
       */
      if (group != null) {
        for (String groupItem : group.split(",")) {
          String[] parts = groupItem.split(":");
          String property = parts[0];
          String direction = parts.length > 1 ? parts[1] : null;
          String root = parts.length > 2 ? parts[2] : null;
          config.group(property, direction, root);
        }
      }

      /*
       * Sorting
       */
      if (sort != null) {
        for (String sortItem : sort.split(",")) {
          String[] parts = sortItem.split(":");
          String property = parts[0];
          String direction = parts.length > 1 ? parts[1] : "ASC";
          String root = parts.length > 2 ? parts[2] : null;

          config.sort(property, direction, root);
        }
      }

      /*
       * Buffering
       */
      if (buffered != null && buffered.contains("false")) {
        config.setBuffered(true);
        if (!buffered.equals("true")) {
          String[] parts = buffered.split(":");
          config.setTrailingBufferZone(Integer.valueOf(parts[0]));
          if (parts.length > 1) {
            config.setLeadingBufferZone(Integer.valueOf(parts[1]));
          }
          if (parts.length > 1) {
            config.setPurgePageCount(Integer.valueOf(parts[2]));
          }
        }
      }


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


      /*
       * Load inline data?
       */
      if (inline != null && inline.equals("true")) {
        config.setInline(true);
      }


      if (where != null) {
        config.setWhere(where);
      }

      if (param != null) {
        for (String p : param.split(",")) {
          String[] parts = p.split(":");
          config.param(parts[0], parts[1]);
        }
      }

      if (start != null) {
        config.setStart(Integer.valueOf(start));
      }
     
     

      /*
       * The proxy needs additinoal information from the store.  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));
      }


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


      /*
       * Create the store
       */
      AdaptrexSession session = new AdaptrexSession(persistence);
      Store store = new Store(session, config);


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

      /*
       * If our store doesn't have a class drop out
       */
      if (clazz == null) {
        write("<!-- Error creating store: Could not find entity for " + className + " -->\n");
        return;
      }


      /*
       * Various store options
       */
      if (pageSize != null) {
        config.setPageSize(Integer.valueOf(pageSize));
      }
      if (include != null) {
        config.include(include);
      }
      if (exclude != null) {
        config.exclude(exclude);
      }

      if (clearOnPageLoad != null && clearOnPageLoad.equals("true")) {
        config.setClearOnPageLoad(true);
      }
      if (clearRemovedOnLoad != null && clearRemovedOnLoad.equals("true")) {
        config.setClearRemovedOnLoad(true);
      }
      if (autoSync != null && autoSync.equals("true")) {
        config.setAutoSync(true);
      }
      if (autoLoad != null && autoLoad.equals("true")) {
        config.setAutoLoad(true);
      }
      if (remoteGroup != null && remoteGroup.equals("true")) {
        config.setRemoteGroup(true);
      }
      if (remoteSort != null && remoteSort.equals("true")) {
        config.setRemoteSort(true);
      }
      if (remoteFilter != null && remoteFilter.equals("true")) {
        config.setRemoteFilter(true);
      }
      if (sortOnFilter != null && sortOnFilter.equals("true")) {
        config.setSortOnFilter(true);
      }


      /*
       * Filtering
       */
      if (filter != null) {
        for (String filterItem : filter.split(",")) {
          String[] parts = filterItem.split("=");
          String property = parts[0];
          String value = parts.length > 1 ? parts[1] : null;
          config.filter(property, value);
        }
      }


      /*
       * Grouping
       */
      if (group != null) {
        for (String groupItem : group.split(",")) {
          String[] parts = groupItem.split(":");
          String property = parts[0];
          String direction = parts.length > 1 ? parts[1] : null;
          String root = parts.length > 2 ? parts[2] : null;
          config.group(property, direction, root);
        }
      }

      /*
       * Sorting
       */
      if (sort != null) {
        for (String sortItem : sort.split(",")) {
          String[] parts = sortItem.split(":");
          String property = parts[0];
          String direction = parts.length > 1 ? parts[1] : "ASC";
          String root = parts.length > 2 ? parts[2] : null;

          config.sort(property, direction, root);
        }
      }

      /*
       * Buffering
       */
      if (buffered != null && buffered.contains("false")) {
        config.setBuffered(true);
        if (!buffered.equals("true")) {
          String[] parts = buffered.split(":");
          config.setTrailingBufferZone(Integer.valueOf(parts[0]));
          if (parts.length > 1) {
            config.setLeadingBufferZone(Integer.valueOf(parts[1]));
          }
          if (parts.length > 1) {
            config.setPurgePageCount(Integer.valueOf(parts[2]));
          }
        }
      }


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


      /*
       * Load inline data?
       */
      if (inline != null && inline.equals("true")) {
        config.setInline(true);
      }


      if (where != null) {
        config.setWhere(where);
      }

      if (param != null) {
        for (String p : param.split(",")) {
          String[] parts = p.split(":");
          config.param(parts[0], parts[1]);
        }
      }

      if (start != null) {
        config.setStart(Integer.valueOf(start));
      }
     
     

      /*
       * The proxy needs additinoal information from the store.  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));
      }


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

       
       
        /*
         * Create the store
         */
        Store store = new Store(className, ns);
       
        /*
         * Set the model name
         */
        if (name != null) store.modelName(name);
       
        /*
         * If our store doesn't have a class drop out
         */
        Class<?> clazz = store.getConfig().getClazz();
        if (clazz == null) {
        write ("<!-- Error creating store: Could not find entity for " + className + " -->\n");
        return;       
        }
       
       
        /*
         * Various store options
         */
        if (pageSize != null) store.pageSize(Integer.valueOf(pageSize));
        if (include != null) store.include(include);
        if (exclude != null) store.exclude(exclude);
       
        if (clearOnPageLoad != null   && clearOnPageLoad.equals("true"))    store.clearOnPageLoad();
        if (clearRemovedOnLoad != null  && clearRemovedOnLoad.equals("true"))   store.clearRemovedOnLoad();
        if (autoSync != null      && autoSync.equals("true"))       store.autoSync();
        if (autoLoad != null      && autoLoad.equals("true"))       store.autoLoad();
        if (buffered != null      && !buffered.equals("false"))       store.buffered();
        if (remoteGroup != null      && remoteGroup.equals("true"))      store.remoteGroup();
        if (remoteSort != null      && remoteSort.equals("true"))      store.remoteSort();
        if (remoteFilter != null    && remoteFilter.equals("true"))      store.remoteFilter(true);
        if (sortOnFilter != null    && sortOnFilter.equals("true"))      store.sortOnFilter(true);
       
       
        /*
         * Filtering
         */
        if (filter != null) {
          for (String filterItem : filter.split(",")) {
              String[] parts = filterItem.split("=");
              String property = parts[0];
              String value = parts.length > 1 ? parts[1] : null;
              store.filter(property, value);
          }
        }
       
       
        /*
         * Grouping
         */
        if (group != null) {
          for (String groupItem : group.split(",")) {
              String[] parts = groupItem.split(":");
              String property = parts[0];
              String direction = parts.length > 1 ? parts[1] : null;
              String root = parts.length > 2 ? parts[2] : null;
              store.group(property, direction, root);
          }
        }
 
        /*
         * Sorting
         */
        if (sort != null) {
          for (String sortItem : sort.split(",")) {
              String[] parts = sortItem.split(":");
              String property = parts[0];
              String direction = parts.length > 1 ? parts[1] : "ASC";
              String root = parts.length > 2 ? parts[2] : null;
             
              store.sort(property, direction, root);
          }
        }
       
        /*
         * Buffering
         */
        if (buffered != null) {
          store.buffered();
          if (!buffered.equals("true")) {
            String[] parts = buffered.split(":");
            store.trailingBufferZone(Integer.valueOf(parts[0]));
            if (parts.length > 1) store.leadingBufferZone(Integer.valueOf(parts[1]));
            if (parts.length > 1) store.purgePageCount(Integer.valueOf(parts[2]));
          }
        }
       
       
        /*
         * Add associations
         */
        if (associations != null) store.associations(associations);

       
        /*
         * Load inline data?
         */
        if (inline != null && inline.equals("true")) {
          store.inline();
 
          if (where != null) store.where(where);
         
          if (param != null) {
            for (String p : param.split(",")) {
                String[] parts = p.split(":");
                store.param(parts[0],parts[1]);
              }
          }
         
          if (start != null) store.start(Integer.valueOf(start));
        }
       
       
        /*
         * The proxy needs additinoal information from the store.  We shouldn't create
         * the proxy until the store has been fully configured
         */
        if (rest != null) {
          String restPath = getRequest().getContextPath() + "/rest/";
          store.proxy(restPath + (rest.equals("true") ? clazz.getSimpleName().toLowerCase() : rest));
        }
       
       
       
        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" +
View Full Code Here

       
       
        /*
         * Create the store
         */
        Store store = new Store(className, ns);
       
        /*
         * Set the model name
         */
        if (name != null) store.modelName(name);
       
        /*
         * If our store doesn't have a class drop out
         */
        Class<?> clazz = store.getConfig().getClazz();
        if (clazz == null) {
        write ("<!-- Error creating store: Could not find entity for " + className + " -->\n");
        return;       
        }
       
       
        /*
         * Various store options
         */
        if (pageSize != null) store.pageSize(Integer.valueOf(pageSize));
        if (include != null) store.include(include);
        if (exclude != null) store.exclude(exclude);
       
        if (clearOnPageLoad != null   && clearOnPageLoad.equals("true"))    store.clearOnPageLoad();
        if (clearRemovedOnLoad != null  && clearRemovedOnLoad.equals("true"))   store.clearRemovedOnLoad();
        if (autoSync != null      && autoSync.equals("true"))       store.autoSync();
        if (autoLoad != null      && autoLoad.equals("true"))       store.autoLoad();
        if (buffered != null      && !buffered.equals("false"))       store.buffered();
        if (remoteGroup != null      && remoteGroup.equals("true"))      store.remoteGroup();
        if (remoteSort != null      && remoteSort.equals("true"))      store.remoteSort();
        if (remoteFilter != null    && remoteFilter.equals("true"))      store.remoteFilter(true);
        if (sortOnFilter != null    && sortOnFilter.equals("true"))      store.sortOnFilter(true);
       
       
        /*
         * Filtering
         */
        if (filter != null) {
          for (String filterItem : filter.split(",")) {
              String[] parts = filterItem.split("=");
              String property = parts[0];
              String value = parts.length > 1 ? parts[1] : null;
              store.filter(property, value);
          }
        }
       
       
        /*
         * Grouping
         */
        if (group != null) {
          for (String groupItem : group.split(",")) {
              String[] parts = groupItem.split(":");
              String property = parts[0];
              String direction = parts.length > 1 ? parts[1] : null;
              String root = parts.length > 2 ? parts[2] : null;
              store.group(property, direction, root);
          }
        }
 
        /*
         * Sorting
         */
        if (sort != null) {
          for (String sortItem : sort.split(",")) {
              String[] parts = sortItem.split(":");
              String property = parts[0];
              String direction = parts.length > 1 ? parts[1] : "ASC";
              String root = parts.length > 2 ? parts[2] : null;
             
              store.sort(property, direction, root);
          }
        }
       
        /*
         * Buffering
         */
        if (buffered != null) {
          store.buffered();
          if (!buffered.equals("true")) {
            String[] parts = buffered.split(":");
            store.trailingBufferZone(Integer.valueOf(parts[0]));
            if (parts.length > 1) store.leadingBufferZone(Integer.valueOf(parts[1]));
            if (parts.length > 1) store.purgePageCount(Integer.valueOf(parts[2]));
          }
        }
       
       
        /*
         * Add associations
         */
        if (associations != null) store.associations(associations);

       
        /*
         * Load inline data?
         */
        if (inline != null && inline.equals("true")) {
          store.inline();
 
          if (where != null) store.where(where);
         
          if (param != null) {
            for (String p : param.split(",")) {
                String[] parts = p.split(":");
                store.param(parts[0],parts[1]);
              }
          }
         
          if (start != null) store.start(Integer.valueOf(start));
        }
       
       
        /*
         * The proxy needs additinoal information from the store.  We shouldn't create
         * the proxy until the store has been fully configured
         */
        if (rest != null) {
          String restPath = getRequest().getContextPath() + "/rest/";
          store.proxy(restPath + (rest.equals("true") ? clazz.getSimpleName().toLowerCase() : rest));
        }
       
       
       
        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" +
View Full Code Here

      /*
       * Create the store
       */
      AdaptrexSession session = new AdaptrexSession(persistence);
      Store store = new Store(session, config);


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

      /*
       * If our store doesn't have a class drop out
       */
      if (clazz == null) {
        write("<!-- Error creating store: Could not find entity for " + className + " -->\n");
        return;
      }


      /*
       * Various store options
       */
      if (pageSize != null) {
        config.setPageSize(Integer.valueOf(pageSize));
      }
      if (include != null) {
        config.include(include);
      }
      if (exclude != null) {
        config.exclude(exclude);
      }

      if (clearOnPageLoad != null && clearOnPageLoad.equals("true")) {
        config.setClearOnPageLoad(true);
      }
      if (clearRemovedOnLoad != null && clearRemovedOnLoad.equals("true")) {
        config.setClearRemovedOnLoad(true);
      }
      if (autoSync != null && autoSync.equals("true")) {
        config.setAutoSync(true);
      }
      if (autoLoad != null && autoLoad.equals("true")) {
        config.setAutoLoad(true);
      }
      if (remoteGroup != null && remoteGroup.equals("true")) {
        config.setRemoteGroup(true);
      }
      if (remoteSort != null && remoteSort.equals("true")) {
        config.setRemoteSort(true);
      }
      if (remoteFilter != null && remoteFilter.equals("true")) {
        config.setRemoteFilter(true);
      }
      if (sortOnFilter != null && sortOnFilter.equals("true")) {
        config.setSortOnFilter(true);
      }


      /*
       * Filtering
       */
      if (filter != null) {
        for (String filterItem : filter.split(",")) {
          String[] parts = filterItem.split("=");
          String property = parts[0];
          String value = parts.length > 1 ? parts[1] : null;
          config.filter(property, value);
        }
      }


      /*
       * Grouping
       */
      if (group != null) {
        for (String groupItem : group.split(",")) {
          String[] parts = groupItem.split(":");
          String property = parts[0];
          String direction = parts.length > 1 ? parts[1] : null;
          String root = parts.length > 2 ? parts[2] : null;
          config.group(property, direction, root);
        }
      }

      /*
       * Sorting
       */
      if (sort != null) {
        for (String sortItem : sort.split(",")) {
          String[] parts = sortItem.split(":");
          String property = parts[0];
          String direction = parts.length > 1 ? parts[1] : "ASC";
          String root = parts.length > 2 ? parts[2] : null;

          config.sort(property, direction, root);
        }
      }

      /*
       * Buffering
       */
      if (buffered != null && buffered.contains("false")) {
        config.setBuffered(true);
        if (!buffered.equals("true")) {
          String[] parts = buffered.split(":");
          config.setTrailingBufferZone(Integer.valueOf(parts[0]));
          if (parts.length > 1) {
            config.setLeadingBufferZone(Integer.valueOf(parts[1]));
          }
          if (parts.length > 1) {
            config.setPurgePageCount(Integer.valueOf(parts[2]));
          }
        }
      }


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


      /*
       * Load inline data?
       */
      if (inline != null && inline.equals("true")) {
        config.setInline(true);
      }


      if (where != null) {
        config.setWhere(where);
      }

      if (param != null) {
        for (String p : param.split(",")) {
          String[] parts = p.split(":");
          config.param(parts[0], parts[1]);
        }
      }

      if (start != null) {
        config.setStart(Integer.valueOf(start));
      }
     
     

      /*
       * The proxy needs additinoal information from the store.  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));
      }


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

TOP

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

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.