}
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);