Package com.adaptrex.core.view

Examples of com.adaptrex.core.view.StoreComponent


  public String getBody() {
    HttpServletRequest request = requestGlobals.getHTTPServletRequest();
   
    if (ns == null) ns = namespace;
   
    StoreComponent storeComponent = new StoreComponent(request, table, factory);
    if (ns != null)       storeComponent.setNamespace(ns);
   
    if (name != null)      storeComponent.setModelName(name);
    if (include != null)    storeComponent.setInclude(include);
    if (exclude != null)    storeComponent.setExclude(exclude);
    if (associations != null)   storeComponent.setAssociations(associations);
    if (where != null)       storeComponent.setWhere(where);
   
    if (pagesize != null)
      storeComponent.setPageSize(getInteger(pagesize));
    if (start != null)      
      storeComponent.setStart(getInteger(start));
   
   
    if (rest != null)
      storeComponent.setRest(String.valueOf(rest));
     
    if (clearonpageload != null)
      storeComponent.setClearOnPageLoad(getBoolean(clearonpageload));

    if (clearremovedonload != null)
      storeComponent.setClearRemovedOnLoad(getBoolean(clearremovedonload));
     
    if (autosync != null)
      storeComponent.setAutoSync(getBoolean(autosync));
   
    if (autoload != null)
      storeComponent.setAutoLoad(getBoolean(autoload));
   
    if (remotegroup != null)
      storeComponent.setRemoteGroup(getBoolean(remotegroup));
   
    if (remotesort != null)
      storeComponent.setRemoteSort(getBoolean(remotesort));
   
    if (remotefilter != null)
      storeComponent.setRemoteFilter(getBoolean(remotefilter));
   
    if (sortonfilter != null)
      storeComponent.setSortOnFilter(getBoolean(sortonfilter));
   
    if (inline != null)
      storeComponent.setInline(getBoolean(inline));
   
   
    if (buffered != null && !buffered.contains("false")) {
      storeComponent.setBuffered(true);
      if (!buffered.equals("true")) {
        String[] parts = buffered.split(":");
        storeComponent.setTrailingBufferZone(Integer.valueOf(parts[0]));
        if (parts.length > 0) {
          storeComponent.setLeadingBufferZone(Integer.valueOf(parts[1]));
        }
        if (parts.length > 1) {
          storeComponent.setPurgePageCount(Integer.valueOf(parts[2]));
        }
      }
    }
   
    if (param != null) {
      for (String p : param.split(",")) {
        String[] parts = p.split("=");
        storeComponent.addParam(parts[0], parts[1]);
      }
    }
   
    if (filter != null) {
      for (String p : filter.split(",")) {
        String[] parts = p.split("=");
        storeComponent.addFilter(parts[0], parts[1]);
      }
    }
   
    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;
        storeComponent.addGrouper(property, direction, root);
      }
    }
   
    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;
        storeComponent.addSorter(property, direction, root);
      }
    }
   
    return storeComponent.toString();
  }
View Full Code Here


    if (namespace == null) namespace = (String) a.get("namespace");
       
    /*
     * Create the store component
     */
    StoreComponent storeComponent = new StoreComponent(request, table, factory);
    storeComponent.setNamespace(namespace);
   
    if (modelName != null)    storeComponent.setModelName(modelName);
    if (include != null)    storeComponent.setInclude(include);
    if (exclude != null)    storeComponent.setExclude(exclude);
    if (associations != null)   storeComponent.setAssociations(associations);
    if (pageSize != null)     storeComponent.setPageSize(Integer.valueOf(pageSize));
    if (start != null)       storeComponent.setStart(Integer.valueOf(start));
    if (where != null)       storeComponent.setWhere(where);
   
    if (rest != null && !rest.equals("false"))  {
      storeComponent.setRest(rest);
    }
    if (clearOnPageLoad != null && clearOnPageLoad.equals("true")) {
      storeComponent.setClearOnPageLoad(true);
    }
    if (clearRemovedOnLoad != null && clearRemovedOnLoad.equals("true")) {
      storeComponent.setClearRemovedOnLoad(true);
    }
    if (autoSync != null && autoSync.equals("true")) {
      storeComponent.setAutoSync(true);
    }
    if (autoLoad != null && autoLoad.equals("true")) {
      storeComponent.setAutoLoad(true);
    }
    if (remoteGroup != null && remoteGroup.equals("true")) {
      storeComponent.setRemoteGroup(true);
    }
    if (remoteSort != null && remoteSort.equals("true")) {
      storeComponent.setRemoteSort(true);
    }
    if (remoteFilter != null && remoteFilter.equals("true")) {
      storeComponent.setRemoteFilter(true);
    }
    if (sortOnFilter != null && sortOnFilter.equals("true")) {
      storeComponent.setSortOnFilter(true);
    }
    if (inline != null && inline.equals("true")) {
      storeComponent.setInline(true);
    }
   
   
    if (buffered != null && !buffered.contains("false")) {
      storeComponent.setBuffered(true);
      if (!buffered.equals("true")) {
        String[] parts = buffered.split(":");
        storeComponent.setTrailingBufferZone(Integer.valueOf(parts[0]));
        if (parts.length > 1) {
          storeComponent.setLeadingBufferZone(Integer.valueOf(parts[1]));
        }
        if (parts.length > 1) {
          storeComponent.setPurgePageCount(Integer.valueOf(parts[2]));
        }
      }
    }
   
   
    if (param != null) {
      for (String p : param.split(",")) {
        String[] parts = p.split("=");
        storeComponent.addParam(parts[0], parts[1]);
      }
    }
   
    if (filter != null) {
      for (String p : filter.split(",")) {
        String[] parts = p.split("=");
        storeComponent.addFilter(parts[0], parts[1]);
      }
    }
   
    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;
        storeComponent.addGrouper(property, direction, root);
      }
    }
   
    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;
        storeComponent.addSorter(property, direction, root);
      }
    }
   
    context.getResponseWriter().write(storeComponent.toString());
  }
View Full Code Here

  public String getBody() {
    HttpServletRequest request = requestGlobals.getHTTPServletRequest();
   
    if (ns == null) ns = namespace;
   
    StoreComponent storeComponent = new StoreComponent(request, table, factory);
    if (ns != null)       storeComponent.setNamespace(ns);
   
    if (name != null)      storeComponent.setModelName(name);
    if (include != null)    storeComponent.setInclude(include);
    if (exclude != null)    storeComponent.setExclude(exclude);
    if (associations != null)   storeComponent.setAssociations(associations);
    if (where != null)       storeComponent.setWhere(where);
   
    if (pagesize != null)
      storeComponent.setPageSize(getInteger(pagesize));
    if (start != null)      
      storeComponent.setStart(getInteger(start));
   
   
    if (rest != null)
      storeComponent.setRest(String.valueOf(rest));
     
    if (clearonpageload != null)
      storeComponent.setClearOnPageLoad(getBoolean(clearonpageload));

    if (clearremovedonload != null)
      storeComponent.setClearRemovedOnLoad(getBoolean(clearremovedonload));
     
    if (autosync != null)
      storeComponent.setAutoSync(getBoolean(autosync));
   
    if (autoload != null)
      storeComponent.setAutoLoad(getBoolean(autoload));
   
    if (remotegroup != null)
      storeComponent.setRemoteGroup(getBoolean(remotegroup));
   
    if (remotesort != null)
      storeComponent.setRemoteSort(getBoolean(remotesort));
   
    if (remotefilter != null)
      storeComponent.setRemoteFilter(getBoolean(remotefilter));
   
    if (sortonfilter != null)
      storeComponent.setSortOnFilter(getBoolean(sortonfilter));
   
    if (inline != null)
      storeComponent.setInline(getBoolean(inline));
   
   
    if (buffered != null && !buffered.contains("false")) {
      storeComponent.setBuffered(true);
      if (!buffered.equals("true")) {
        String[] parts = buffered.split(":");
        storeComponent.setTrailingBufferZone(Integer.valueOf(parts[0]));
        if (parts.length > 0) {
          storeComponent.setLeadingBufferZone(Integer.valueOf(parts[1]));
        }
        if (parts.length > 1) {
          storeComponent.setPurgePageCount(Integer.valueOf(parts[2]));
        }
      }
    }
   
    if (param != null) {
      for (String p : param.split(",")) {
        String[] parts = p.split("=");
        storeComponent.addParam(parts[0], parts[1]);
      }
    }
   
    if (filter != null) {
      for (String p : filter.split(",")) {
        String[] parts = p.split("=");
        storeComponent.addFilter(parts[0], parts[1]);
      }
    }
   
    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;
        storeComponent.addGrouper(property, direction, root);
      }
    }
   
    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;
        storeComponent.addSorter(property, direction, root);
      }
    }
   
    return storeComponent.toString();
  }
View Full Code Here

    }
   
    /*
     * Create the store component
     */
    StoreComponent storeComponent = new StoreComponent(request, table, factory);
    storeComponent.setNamespace(namespace);
   
    if (modelName != null)    storeComponent.setModelName(modelName);
    if (include != null)    storeComponent.setInclude(include);
    if (exclude != null)    storeComponent.setExclude(exclude);
    if (associations != null)   storeComponent.setAssociations(associations);
    if (pageSize != null)     storeComponent.setPageSize(Integer.valueOf(pageSize));
    if (start != null)       storeComponent.setStart(Integer.valueOf(start));
    if (where != null)       storeComponent.setWhere(where);
   
    if (rest != null && !rest.equals("false"))  {
      storeComponent.setRest(rest);
    }
    if (clearOnPageLoad != null && clearOnPageLoad.equals("true")) {
      storeComponent.setClearOnPageLoad(true);
    }
    if (clearRemovedOnLoad != null && clearRemovedOnLoad.equals("true")) {
      storeComponent.setClearRemovedOnLoad(true);
    }
    if (autoSync != null && autoSync.equals("true")) {
      storeComponent.setAutoSync(true);
    }
    if (autoLoad != null && autoLoad.equals("true")) {
      storeComponent.setAutoLoad(true);
    }
    if (remoteGroup != null && remoteGroup.equals("true")) {
      storeComponent.setRemoteGroup(true);
    }
    if (remoteSort != null && remoteSort.equals("true")) {
      storeComponent.setRemoteSort(true);
    }
    if (remoteFilter != null && remoteFilter.equals("true")) {
      storeComponent.setRemoteFilter(true);
    }
    if (sortOnFilter != null && sortOnFilter.equals("true")) {
      storeComponent.setSortOnFilter(true);
    }
    if (inline != null && inline.equals("true")) {
      storeComponent.setInline(true);
    }
   
   
    if (buffered != null && !buffered.contains("false")) {
      storeComponent.setBuffered(true);
      if (!buffered.equals("true")) {
        String[] parts = buffered.split(":");
        storeComponent.setTrailingBufferZone(Integer.valueOf(parts[0]));
        if (parts.length > 1) {
          storeComponent.setLeadingBufferZone(Integer.valueOf(parts[1]));
        }
        if (parts.length > 1) {
          storeComponent.setPurgePageCount(Integer.valueOf(parts[2]));
        }
      }
    }
   
   
    if (param != null) {
      for (String p : param.split(",")) {
        String[] parts = p.split("=");
        storeComponent.addParam(parts[0], parts[1]);
      }
    }
   
    if (filter != null) {
      for (String p : filter.split(",")) {
        String[] parts = p.split("=");
        storeComponent.addFilter(parts[0], parts[1]);
      }
    }
   
    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;
        storeComponent.addGrouper(property, direction, root);
      }
    }
   
    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;
        storeComponent.addSorter(property, direction, root);
      }
    }
   
    context.getResponseWriter().write(storeComponent.toString());
  }
View Full Code Here

    }
   
    /*
     * Create the store component
     */
    StoreComponent storeComponent = new StoreComponent(request, table, factory);
    storeComponent.setNamespace(namespace);
   
    if (modelName != null)    storeComponent.setModelName(modelName);
    if (include != null)    storeComponent.setInclude(include);
    if (exclude != null)    storeComponent.setExclude(exclude);
    if (associations != null)   storeComponent.setAssociations(associations);
    if (pageSize != null)     storeComponent.setPageSize(Integer.valueOf(pageSize));
    if (start != null)       storeComponent.setStart(Integer.valueOf(start));
    if (where != null)       storeComponent.setStart(Integer.valueOf(where));
   
    if (rest != null && !rest.equals("false"))  {
      storeComponent.setRest(rest);
    }
    if (clearOnPageLoad != null && clearOnPageLoad.equals("true")) {
      storeComponent.setClearOnPageLoad(true);
    }
    if (clearRemovedOnLoad != null && clearRemovedOnLoad.equals("true")) {
      storeComponent.setClearRemovedOnLoad(true);
    }
    if (autoSync != null && autoSync.equals("true")) {
      storeComponent.setAutoSync(true);
    }
    if (autoLoad != null && autoLoad.equals("true")) {
      storeComponent.setAutoLoad(true);
    }
    if (remoteGroup != null && remoteGroup.equals("true")) {
      storeComponent.setRemoteGroup(true);
    }
    if (remoteSort != null && remoteSort.equals("true")) {
      storeComponent.setRemoteSort(true);
    }
    if (remoteFilter != null && remoteFilter.equals("true")) {
      storeComponent.setRemoteFilter(true);
    }
    if (sortOnFilter != null && sortOnFilter.equals("true")) {
      storeComponent.setSortOnFilter(true);
    }
    if (inline != null && inline.equals("true")) {
      storeComponent.setInline(true);
    }
   
   
    if (buffered != null && !buffered.contains("false")) {
      storeComponent.setBuffered(true);
      if (!buffered.equals("true")) {
        String[] parts = buffered.split(":");
        storeComponent.setTrailingBufferZone(Integer.valueOf(parts[0]));
        if (parts.length > 1) {
          storeComponent.setLeadingBufferZone(Integer.valueOf(parts[1]));
        }
        if (parts.length > 1) {
          storeComponent.setPurgePageCount(Integer.valueOf(parts[2]));
        }
      }
    }
   
   
    if (param != null) {
      for (String p : param.split(",")) {
        String[] parts = p.split("=");
        storeComponent.addParam(parts[0], parts[1]);
      }
    }
   
    if (filter != null) {
      for (String p : filter.split(",")) {
        String[] parts = p.split("=");
        storeComponent.addFilter(parts[0], parts[1]);
      }
    }
   
    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;
        storeComponent.addGrouper(property, direction, root);
      }
    }
   
    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;
        storeComponent.addSorter(property, direction, root);
      }
    }
   
    context.getResponseWriter().write(storeComponent.toString());
  }
View Full Code Here

  @Parameter @Property private String associations;
 
  public String getBody() throws Exception {
    HttpServletRequest request = requestGlobals.getHTTPServletRequest();

    StoreComponent storeComponent = new StoreComponent(
        request,
        table,
        factory,
        namespace != null ? namespace : ns
      );
    storeComponent
    .applyModelName(modelname)
   
    .applyInline(inline)
    .applyRest(rest)
    .applyAutoLoad(autoload)
   
    .applyStart(start)
    .applyPageSize(pagesize)
   
    .applyInclude(include)
    .applyExclude(exclude)
    .applyAssociations(associations)
   
    .applyWhere(where)
    .applyParams(params)
    .applyFilters(filter)
   
    .applySorters(sort)
    .applyGroupers(group)
   
    .applyBuffered(buffered)
    .applyTrailingBufferZone(trailingbufferone)
    .applyLeadingBufferZone(leadingbufferzone)
    .applyPurgePageCount(purgepagecount)
   
    .applyClearOnPageLoad(clearonpageload)
    .applyClearRemovedOnLoad(clearremovedonload)
    .applyAutoSync(autosync)
    .applyRemoteGroup(remotegroup)
    .applyRemoteSort(remotesort)
    .applyRemoteFilter(remotefilter)
    .applySortOnFilter(sortonfilter)
    ;

   
    return storeComponent.getJavaScript();
  }
View Full Code Here

  @Override
  public int doStartTag() {
    HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
   
    StoreComponent storeComponent = new StoreComponent(
        request,
        this.table,
        this.factory,
        this.namespace != null ? this.namespace : this.ns
      );
   
    storeComponent

    .applyModelName(this.modelname)
   
    .applyInline(this.inline)
    .applyRest(this.rest)
    .applyAutoLoad(this.autoload)
   
    .applyStart(this.start)
    .applyPageSize(this.pagesize)
   
    .applyInclude(this.include)
    .applyExclude(this.exclude)
    .applyAssociations(this.associations)
   
    .applyWhere(this.where)
    .applyParams(this.params)
    .applyFilters(this.filter)
   
    .applySorters(this.sort)
    .applyGroupers(this.group)
   
    .applyBuffered(this.buffered)
    .applyTrailingBufferZone(this.trailingbufferzone)
    .applyLeadingBufferZone(this.leadingbufferzone)
    .applyPurgePageCount(this.purgepagecount)
   
    .applyClearOnPageLoad(this.clearonpageload)
    .applyClearRemovedOnLoad(this.clearremovedonload)
    .applyAutoSync(this.autosync)
    .applyRemoteGroup(this.remotegroup)
    .applyRemoteSort(this.remotesort)
    .applyRemoteFilter(this.remotefilter)
    .applySortOnFilter(this.sortonfilter)
    ;
   
    try {
      pageContext.getOut().write(storeComponent.getJavaScript());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
    return SKIP_BODY;
  }
View Full Code Here

    ExternalContext external = context.getExternalContext();
    HttpServletRequest request = (HttpServletRequest) external.getRequest();
   
    Map<String,String> a = JSFUtils.normalizeAttributes(getAttributes());
   
    StoreComponent storeComponent = new StoreComponent(
        request,
        a.get("table"),
        a.get("factory"),
        a.get("namespace") != null ? a.get("namespace") : a.get("ns")
      );
   
    storeComponent
    .applyModelName(a.get("modelname"))
   
    .applyInline(a.get("inline"))
    .applyRest(a.get("rest"))
    .applyAutoLoad(a.get("autoload"))
   
    .applyStart(a.get("start"))
    .applyPageSize(a.get("pagesize"))
   
    .applyInclude(a.get("include"))
    .applyExclude(a.get("exclude"))
    .applyAssociations(a.get("associations"))
   
    .applyWhere(a.get("where"))
    .applyParams(a.get("params"))
    .applyFilters(a.get("filter"))
   
    .applySorters(a.get("sort"))
    .applyGroupers(a.get("group"))
   
    .applyBuffered(a.get("buffered"))
    .applyTrailingBufferZone(a.get("trailingbufferzone"))
    .applyLeadingBufferZone(a.get("leadingbufferzone"))
    .applyPurgePageCount(a.get("purgepagecount"))   
   
    .applyClearOnPageLoad(a.get("clearonpageload"))
    .applyClearRemovedOnLoad(a.get("clearremovedonload"))
    .applyAutoSync(a.get("autosync"))
    .applyRemoteGroup(a.get("remotegroup"))
    .applyRemoteSort(a.get("remotesort"))
    .applyRemoteFilter(a.get("remotefilter"))
    .applySortOnFilter(a.get("sortonfilter"))
    ;
   
    try {
      context.getResponseWriter().write(storeComponent.getJavaScript());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.adaptrex.core.view.StoreComponent

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.