org.broadleafcommerce.openadmin.client.datasource.dynamic
Class DynamicEntityDataSource

java.lang.Object
  extended by com.smartgwt.client.core.BaseClass
      extended by com.smartgwt.client.data.DataSource
          extended by org.broadleafcommerce.openadmin.client.datasource.GwtRpcDataSource
              extended by org.broadleafcommerce.openadmin.client.datasource.dynamic.AbstractDynamicDataSource
                  extended by org.broadleafcommerce.openadmin.client.datasource.dynamic.DynamicEntityDataSource
All Implemented Interfaces:
com.google.gwt.event.shared.HasHandlers, com.smartgwt.client.data.events.HasHandleErrorHandlers
Direct Known Subclasses:
ColumnTreeDataSource, PresentationLayerAssociatedDataSource

public class DynamicEntityDataSource
extends AbstractDynamicDataSource

Author:
jfischer

Field Summary
 
Fields inherited from class org.broadleafcommerce.openadmin.client.datasource.dynamic.AbstractDynamicDataSource
addedRecord, defaultNewEntityFullyQualifiedClassname, formItemCallbackHandlerManager, modules, persistencePerspective, polymorphicEntities, polymorphicEntityTree, service, showArchived
 
Fields inherited from class com.smartgwt.client.core.BaseClass
config, id, scClassName
 
Constructor Summary
DynamicEntityDataSource(String ceilingEntityClassName)
          Creates a datasource capable of all CRUD operations on the passed in Entity.
DynamicEntityDataSource(String name, PersistencePerspective persistencePerspective, DynamicEntityServiceAsync service, DataSourceModule[] modules)
          Note that the name parameter on this constructor is not meaningful to the internal representation of DynamicEntityDataSource.
 
Method Summary
 void buildFields(String[] customCriteria, Boolean overrideFieldSort, com.google.gwt.user.client.rpc.AsyncCallback<com.smartgwt.client.data.DataSource> cb)
           
 com.smartgwt.client.data.Criteria createRelationshipCriteria(String relationshipValue)
           
protected  void executeAdd(String requestId, com.smartgwt.client.data.DSRequest request, com.smartgwt.client.data.DSResponse response)
          Executed on ADD operation.
protected  void executeAdd(String requestId, com.smartgwt.client.data.DSRequest request, com.smartgwt.client.data.DSResponse response, String[] customCriteria, com.google.gwt.user.client.rpc.AsyncCallback<com.smartgwt.client.data.DataSource> cb)
           
protected  void executeFetch(String requestId, com.smartgwt.client.data.DSRequest request, com.smartgwt.client.data.DSResponse response)
          Executed on FETCH operation.
protected  void executeFetch(String requestId, com.smartgwt.client.data.DSRequest request, com.smartgwt.client.data.DSResponse response, String[] customCriteria, com.google.gwt.user.client.rpc.AsyncCallback<com.smartgwt.client.data.DataSource> cb)
           
protected  void executeRemove(String requestId, com.smartgwt.client.data.DSRequest request, com.smartgwt.client.data.DSResponse response)
          Executed on REMOVE operation.
protected  void executeRemove(String requestId, com.smartgwt.client.data.DSRequest request, com.smartgwt.client.data.DSResponse response, String[] customCriteria, com.google.gwt.user.client.rpc.AsyncCallback<com.smartgwt.client.data.DataSource> cb)
           
protected  void executeUpdate(String requestId, com.smartgwt.client.data.DSRequest request, com.smartgwt.client.data.DSResponse response)
          Executed on UPDATE operation.
protected  void executeUpdate(String requestId, com.smartgwt.client.data.DSRequest request, com.smartgwt.client.data.DSResponse response, String[] customCriteria, com.google.gwt.user.client.rpc.AsyncCallback<com.smartgwt.client.data.DataSource> cb)
           
 Map extractRecordValues(com.smartgwt.client.widgets.tree.TreeNode record, String... excludeFields)
           
 DataSourceModule getCompatibleModule(OperationType operationType)
           
 PersistencePerspective getPersistencePerspective()
           
 void permanentlyHideFields(String... fieldNames)
           
 void permanentlyShowFields(String... fieldNames)
           
 void resetPermanentFieldVisibility()
           
 void resetPermanentFieldVisibility(String... fieldNames)
           
 void resetPermanentFieldVisibilityBasedOnType(String[] type)
           
 void resetProminenceOnly(String... fieldNames)
           
 void resetVisibilityOnly(String... fieldNames)
           
 void setLinkedValue(String linkedValue)
           
 void setProminent(String... fieldNames)
           
 void setTypeOps(com.google.gwt.core.client.JavaScriptObject type, com.google.gwt.core.client.JavaScriptObject operatorArray)
           
 void setTypeOps(com.smartgwt.client.types.OperatorId... ids)
           
 void updateFriendlyName(String fieldName, String friendlyName)
           
 
Methods inherited from class org.broadleafcommerce.openadmin.client.datasource.dynamic.AbstractDynamicDataSource
buildPolymorphicEntityMap, getAddedRecord, getDefaultNewEntityFullyQualifiedClassname, getFormItemCallbackHandlerManager, getModules, getPolymorphicEntities, getPolymorphicEntityTree, getPrimaryKeyValue, getService, isShowArchived, replaceModuleByType, setAddedRecord, setDefaultNewEntityFullyQualifiedClassname, setFormItemCallbackHandlerManager, setModules, setPolymorphicEntityTree, setService, setShowArchived, stripDuplicateAllowSpecialCharacters
 
Methods inherited from class org.broadleafcommerce.openadmin.client.datasource.GwtRpcDataSource
transformRequest
 
Methods inherited from class com.smartgwt.client.data.DataSource
addData, addData, addData, addField, addHandleErrorHandler, combineCriteria, convertRelativeDates, convertRelativeDates, copyRecord, copyRecords, create, downloadFile, downloadFile, exportClientData, exportData, exportData, fetchData, fetchData, filterData, filterData, get, get, getAddGlobalId, getAutoCacheAllData, getAutoConvertRelativeDates, getAutoDeriveTitles, getCacheAllData, getCacheData, getCacheMaxAge, getCallbackParam, getCanMultiSort, getChildrenField, getClientOnly, getClientOnlyResponse, getCriteriaPolicy, getDataField, getDataFormat, getDataProtocol, getDataSource, getDataSource, getDataTransport, getDataURL, getDefaultParams, getDescriptionField, getDisplayValue, getDropExtraFields, getField, getFieldForDataPath, getFieldNames, getFieldNames, getFieldOperators, getFieldOperators, getFields, getFileURL, getGlobalNamespaces, getIconField, getInfoField, getInheritsFrom, getJsObj, getJsonPrefix, getJsonSuffix, getLegalChildTags, getOperationBindings, getOrCreateRef, getPluralTitle, getPreventHTTPCaching, getPrimaryKeyField, getPrimaryKeyFieldName, getQualifyColumnNames, getRecordXPath, getRequestProperties, getRequiredMessage, getResultBatchSize, getResultSetClass, getSchemaNamespace, getSendExtraFields, getServiceNamespace, getShowLocalFieldsOnly, getShowPrompt, getSortBy, getSortSpecifiers, getStrictSQLFiltering, getTagName, getTestData, getTitle, getTitleField, getTypeOperators, getUseFlatFields, getUseHttpProxy, getUseLocalValidators, getUseOfflineStorage, getUseParentFieldOrder, getUseTestDataFetch, getValidateRelatedRecords, getWillHandleAdvancedCriteria, hasAllData, invalidateCache, isCreated, load, load, onInit, performCustomOperation, processResponse, recordsFromXML, removeData, removeData, removeData, setAddGlobalId, setAutoCacheAllData, setAutoConvertRelativeDates, setAutoDeriveTitles, setCacheAllData, setCacheData, setCacheMaxAge, setCallbackParam, setCanMultiSort, setChildrenField, setClientOnly, setCriteriaPolicy, setDataField, setDataFormat, setDataProtocol, setDataTransport, setDataURL, setDefaultParams, setDescriptionField, setDropExtraFields, setEnumConstantProperty, setEnumOrdinalProperty, setEnumTranslateStrategy, setFields, setGlobalNamespaces, setIconField, setID, setInfoField, setInheritsFrom, setInheritsFrom, setJsonPrefix, setJsonSuffix, setOperationBindings, setPluralTitle, setPreventHTTPCaching, setQualifyColumnNames, setRecordName, setRecordXPath, setRequestProperties, setRequiredMessage, setResultBatchSize, setResultSetClass, setSendExtraFields, setServiceNamespace, setShowLocalFieldsOnly, setShowPrompt, setStrictSQLFiltering, setTagName, setTestData, setTitle, setTitleField, setTypeOperators, setUseFlatFields, setUseHttpProxy, setUseLocalValidators, setUseOfflineStorage, setUseParentFieldOrder, setUseTestDataFetch, setValidateRelatedRecords, setWillHandleAdvancedCriteria, setXmlNamespaces, supportsAdvancedCriteria, supportsTextMatchStyle, transformResponse, updateCaches, updateCaches, updateData, updateData, updateData, useOfflineResponse, validateData, validateData, viewFile, viewFile, xmlSerialize, xmlSerialize, xmlSerialize, xmlSerialize, xmlSerialize
 
Methods inherited from class com.smartgwt.client.core.BaseClass
destroy, doAddHandler, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getConfig, getHandlerCount, getID, getOrCreateJsObj, getRef, getScClassName, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setProperty, setProperty, setProperty, setProperty, setScClassName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

DynamicEntityDataSource

public DynamicEntityDataSource(String ceilingEntityClassName)
Creates a datasource capable of all CRUD operations on the passed in Entity. This constructor handles the simplest needs for an Entity Datasource which is what is called for most of the time. For more advanced needs involving Foreign Keys, Lists, and Maps, the more advanced constructor is required.

Parameters:
ceilingEntityClassName - - The fully qualified name of the ceilingEntity.

DynamicEntityDataSource

public DynamicEntityDataSource(String name,
                               PersistencePerspective persistencePerspective,
                               DynamicEntityServiceAsync service,
                               DataSourceModule[] modules)
Note that the name parameter on this constructor is not meaningful to the internal representation of DynamicEntityDataSource. It is required by superclasses but unused.

Parameters:
name -
persistencePerspective -
service -
modules -
Method Detail

buildFields

public void buildFields(String[] customCriteria,
                        Boolean overrideFieldSort,
                        com.google.gwt.user.client.rpc.AsyncCallback<com.smartgwt.client.data.DataSource> cb)

executeFetch

protected void executeFetch(String requestId,
                            com.smartgwt.client.data.DSRequest request,
                            com.smartgwt.client.data.DSResponse response)
Description copied from class: GwtRpcDataSource
Executed on FETCH operation. processResponse (requestId, response) should be called when operation completes (either successful or failure).

Specified by:
executeFetch in class GwtRpcDataSource
Parameters:
requestId - String extracted from DSRequest.getRequestId ().
request - DSRequest being processed.
response - DSResponse. setData (list) should be called on successful execution of this method. setStatus (<0) should be called on failure.

executeFetch

protected void executeFetch(String requestId,
                            com.smartgwt.client.data.DSRequest request,
                            com.smartgwt.client.data.DSResponse response,
                            String[] customCriteria,
                            com.google.gwt.user.client.rpc.AsyncCallback<com.smartgwt.client.data.DataSource> cb)

executeAdd

protected void executeAdd(String requestId,
                          com.smartgwt.client.data.DSRequest request,
                          com.smartgwt.client.data.DSResponse response)
Description copied from class: GwtRpcDataSource
Executed on ADD operation. processResponse (requestId, response) should be called when operation completes (either successful or failure).

Specified by:
executeAdd in class GwtRpcDataSource
Parameters:
requestId - String extracted from DSRequest.getRequestId ().
request - DSRequest being processed. request.getData () contains record should be added.
response - DSResponse. setData (list) should be called on successful execution of this method. Array should contain single element representing added row. setStatus (<0) should be called on failure.

executeAdd

protected void executeAdd(String requestId,
                          com.smartgwt.client.data.DSRequest request,
                          com.smartgwt.client.data.DSResponse response,
                          String[] customCriteria,
                          com.google.gwt.user.client.rpc.AsyncCallback<com.smartgwt.client.data.DataSource> cb)

executeUpdate

protected void executeUpdate(String requestId,
                             com.smartgwt.client.data.DSRequest request,
                             com.smartgwt.client.data.DSResponse response)
Description copied from class: GwtRpcDataSource
Executed on UPDATE operation. processResponse (requestId, response) should be called when operation completes (either successful or failure).

Specified by:
executeUpdate in class GwtRpcDataSource
Parameters:
requestId - String extracted from DSRequest.getRequestId ().
request - DSRequest being processed. request.getData () contains record should be updated.
response - DSResponse. setData (list) should be called on successful execution of this method. Array should contain single element representing updated row. setStatus (<0) should be called on failure.

executeUpdate

protected void executeUpdate(String requestId,
                             com.smartgwt.client.data.DSRequest request,
                             com.smartgwt.client.data.DSResponse response,
                             String[] customCriteria,
                             com.google.gwt.user.client.rpc.AsyncCallback<com.smartgwt.client.data.DataSource> cb)

executeRemove

protected void executeRemove(String requestId,
                             com.smartgwt.client.data.DSRequest request,
                             com.smartgwt.client.data.DSResponse response)
Description copied from class: GwtRpcDataSource
Executed on REMOVE operation. processResponse (requestId, response) should be called when operation completes (either successful or failure).

Specified by:
executeRemove in class GwtRpcDataSource
Parameters:
requestId - String extracted from DSRequest.getRequestId ().
request - DSRequest being processed. request.getData () contains record should be removed.
response - DSResponse. setData (list) should be called on successful execution of this method. Array should contain single element representing removed row. setStatus (<0) should be called on failure.

executeRemove

protected void executeRemove(String requestId,
                             com.smartgwt.client.data.DSRequest request,
                             com.smartgwt.client.data.DSResponse response,
                             String[] customCriteria,
                             com.google.gwt.user.client.rpc.AsyncCallback<com.smartgwt.client.data.DataSource> cb)

setLinkedValue

public void setLinkedValue(String linkedValue)

getCompatibleModule

public DataSourceModule getCompatibleModule(OperationType operationType)

createRelationshipCriteria

public com.smartgwt.client.data.Criteria createRelationshipCriteria(String relationshipValue)

extractRecordValues

public Map extractRecordValues(com.smartgwt.client.widgets.tree.TreeNode record,
                               String... excludeFields)

resetPermanentFieldVisibility

public void resetPermanentFieldVisibility()

permanentlyHideFields

public void permanentlyHideFields(String... fieldNames)

setProminent

public void setProminent(String... fieldNames)

permanentlyShowFields

public void permanentlyShowFields(String... fieldNames)

resetPermanentFieldVisibility

public void resetPermanentFieldVisibility(String... fieldNames)

resetVisibilityOnly

public void resetVisibilityOnly(String... fieldNames)

resetProminenceOnly

public void resetProminenceOnly(String... fieldNames)

updateFriendlyName

public void updateFriendlyName(String fieldName,
                               String friendlyName)

resetPermanentFieldVisibilityBasedOnType

public void resetPermanentFieldVisibilityBasedOnType(String[] type)

getPersistencePerspective

public PersistencePerspective getPersistencePerspective()
Overrides:
getPersistencePerspective in class AbstractDynamicDataSource

setTypeOps

public void setTypeOps(com.smartgwt.client.types.OperatorId... ids)

setTypeOps

public void setTypeOps(com.google.gwt.core.client.JavaScriptObject type,
                       com.google.gwt.core.client.JavaScriptObject operatorArray)


Copyright © 2013. All Rights Reserved.