Package com.adaptrex.core.ext

Examples of com.adaptrex.core.ext.ExtConfig


    this.configComponent = (ConfigComponent) request.getAttribute(ConfigComponent.ATTRIBUTE);
    if (this.configComponent == null) {
      configComponent = new ConfigComponent(request, namespace, false);
      this.configComponent = (ConfigComponent) request.getAttribute(ConfigComponent.ATTRIBUTE);
   
    this.extConfig = new ExtConfig(request.getServletContext(), entityClassName, factoryName);
  };
View Full Code Here


   
    this.extConfig = new ExtConfig(request.getServletContext(), entityClassName, factoryName);
  };
 
  public String getJavaScript() throws Exception {
    ExtConfig config = this.extConfig;
    if (config.getEntityClass() == null) {
      String str = "Adaptrex Store Error: Persistent Class Not Found (" + this.extConfig.getModelName() + ")";
      log.warn(str);
      return StringUtilities.getErrorJavaScript(str);
    }
   
    if (this.namespace == null) {
      this.namespace = configComponent.getNamespace();
    }
    String modelName = config.getModelName();
   
    /*
     * The first thing a store needs is a model
     */
    ModelComponent modelComponent = new ModelComponent(
        request,
        this.configComponent,
        extConfig,
        this.namespace
      );
    modelComponent.applyRest(this.rest);
   
   
    String fullModelName = this.namespace + ".model." + modelName;
    String storeName = Inflector.getInstance().pluralize(modelName);
    String fullStoreName = this.namespace + ".store." + storeName;
   
    /*
     * Create the store definition
     */
    log.debug("Creating store definition for " + fullModelName);
    StoreDefinition storeDefinition = this.configComponent.isTouch()
        ? new TouchStoreDefinition()
        : new StoreDefinition();
    storeDefinition.setModelName(fullModelName);
   
    storeDefinition.setClearOnPageLoad(this.clearOnPageLoad);
    storeDefinition.setClearRemovedOnLoad(this.clearRemovedOnLoad);
    storeDefinition.setAutoSync(this.autoSync);
    storeDefinition.setAutoLoad(this.autoLoad);
    storeDefinition.setRemoteGroup(this.remoteGroup);
    storeDefinition.setRemoteSort(this.remoteSort);
    storeDefinition.setRemoteFilter(this.remoteFilter);
    storeDefinition.setSortOnFilter(this.sortOnFilter);
    storeDefinition.setBuffered(this.buffered);
    storeDefinition.setTrailingBufferZone(this.trailingBufferZone);
    storeDefinition.setLeadingBufferZone(this.leadingBufferZone);
    storeDefinition.setPurgePageCount(this.purgePageCount);
    storeDefinition.setGroupers(this.groupers);
    storeDefinition.setSorters(this.sorters);
    storeDefinition.setPageSize(this.pageSize);
    storeDefinition.setFilters(this.filters);

    if (this.inline != null && this.inline) {
      AdaptrexStoreData storeData = config.getORMPersistenceManager().getStoreData(config);
      storeData.setFilters(this.filters);
      storeData.setGroupers(this.groupers);
      storeData.setLimit(this.pageSize);
      storeData.setParams(this.params);
      storeData.setSorters(this.sorters);
View Full Code Here

    if (this.configComponent == null) {
      configComponent = new ConfigComponent(request, namespace, false);
      this.configComponent = (ConfigComponent) request.getAttribute(ConfigComponent.ATTRIBUTE);
    }   
   
    this.extConfig = new ExtConfig(request.getServletContext(), entityClassName, factoryName);
  };
View Full Code Here

    this.extConfig = new ExtConfig(request.getServletContext(), entityClassName, factoryName);
  };
 
 
  public String getJavaScript() throws Exception {
    ExtConfig config = this.extConfig;
    AdaptrexPersistenceManager apm = config.getORMPersistenceManager();
   
    if (config.getEntityClass() == null) {
      String str = "Adaptrex Model Error: Persistent Class Not Found (" + this.extConfig.getClassName() + ")";
      log.warn(str);
      return StringUtilities.getErrorJavaScript(str);
    }
   
    String namespace = this.configComponent.getNamespace();
    String modelName = config.getModelName();
   
    List<String> modelDefinitionStrings = new ArrayList<String>();
    String fullModelName = namespace +  ".model." + modelName;
    boolean isTouch = this.configComponent.isTouch();
   
View Full Code Here

    this.configComponent = (ConfigComponent) request.getAttribute(ConfigComponent.ATTRIBUTE);
    if (this.configComponent == null) {
      configComponent = new ConfigComponent(request, namespace, false);
      this.configComponent = (ConfigComponent) request.getAttribute(ConfigComponent.ATTRIBUTE);
   
    this.extConfig = new ExtConfig(request.getServletContext(), entityClassName, factoryName);
  };
View Full Code Here

   
    this.extConfig = new ExtConfig(request.getServletContext(), entityClassName, factoryName);
  };
 
  public String getJavaScript() throws Exception {
    ExtConfig config = this.extConfig;
    if (config.getEntityClass() == null) {
      String str = "Adaptrex Store Error: Persistent Class Not Found (" + this.extConfig.getModelName() + ")";
      log.warn(str);
      return StringUtilities.getErrorJavaScript(str);
    }
   
    String namespace = configComponent.getNamespace();
    String modelName = config.getModelName();
   
    /*
     * The first thing a store needs is a model
     */
    ModelComponent modelComponent = new ModelComponent(
        request,
        this.configComponent,
        extConfig
      );
    modelComponent.applyRest(this.rest);
   
   
    String fullModelName = namespace + ".model." + modelName;
    String storeName = Inflector.getInstance().pluralize(modelName);
    String fullStoreName = namespace + ".store." + storeName;
   
    /*
     * Create the store definition
     */
    log.debug("Creating store definition for " + fullModelName);
    StoreDefinition storeDefinition = new StoreDefinition();
    storeDefinition.setModelName(fullModelName);
   
    storeDefinition.setClearOnPageLoad(this.clearOnPageLoad);
    storeDefinition.setClearRemovedOnLoad(this.clearRemovedOnLoad);
    storeDefinition.setAutoSync(this.autoSync);
    storeDefinition.setAutoLoad(this.autoLoad);
    storeDefinition.setRemoteGroup(this.remoteGroup);
    storeDefinition.setRemoteSort(this.remoteSort);
    storeDefinition.setRemoteFilter(this.remoteFilter);
    storeDefinition.setSortOnFilter(this.sortOnFilter);
    storeDefinition.setBuffered(this.buffered);
    storeDefinition.setTrailingBufferZone(this.trailingBufferZone);
    storeDefinition.setLeadingBufferZone(this.leadingBufferZone);
    storeDefinition.setPurgePageCount(this.purgePageCount);
    storeDefinition.setGroupers(this.groupers);
    storeDefinition.setSorters(this.sorters);
    storeDefinition.setPageSize(this.pageSize);
    storeDefinition.setFilters(this.filters);

    if (this.inline != null && this.inline) {
      AdaptrexStoreData storeData = config.getORMPersistenceManager().getStoreData(config);
      storeData.setFilters(this.filters);
      storeData.setGroupers(this.groupers);
      storeData.setLimit(this.pageSize);
      storeData.setParams(this.params);
      storeData.setSorters(this.sorters);
View Full Code Here

  public RestModel(ServletContext context, String className, UriInfo uriInfo) {
    this(context, className, uriInfo, null);
  }
 
  public RestModel(ServletContext context, String className, UriInfo uriInfo, String factoryName) {
    extConfig = new ExtConfig(context, className, factoryName);
    orm = extConfig.getORMPersistenceManager();
   
    if (uriInfo != null) {
      MultivaluedMap<String,String> params = uriInfo.getQueryParameters();
      if (params.containsKey("include")) {
View Full Code Here

  public RestStore(ServletContext context, String className, UriInfo uriInfo) throws Exception {
    this(context, className, uriInfo, null);
  }
 
  public RestStore(ServletContext context, String className, UriInfo uriInfo, String factoryName) throws Exception {
    ExtConfig extConfig = new ExtConfig(context, className, factoryName);
    this.factoryName = factoryName;
   
    /*
     * Process parameters
     */
    MultivaluedMap<String,String> params = uriInfo.getQueryParameters();

    /*
     * Add include/exclude/associations to the config
     */
    if (params.containsKey("include")) {
      extConfig.setIncludes(params.get("include").get(0));
    }
    if (params.containsKey("exclude")) {
      extConfig.setExcludes(params.get("exclude").get(0));
    }
    if (params.containsKey("associations")) {
      extConfig.setAssociations(params.get("associations").get(0));
    }   
   
    storeData = extConfig.getORMPersistenceManager().getStoreData(extConfig);
   
    if (params.containsKey("start")) {
      if (params.get("start").toString().contains("NaN")) {
        throw new RuntimeException("Buffered stores require a page size to be explicitly set in your component attributes.");
      } else {
View Full Code Here

TOP

Related Classes of com.adaptrex.core.ext.ExtConfig

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.