Package com.smartgwt.client.util
Class MockDSExportSettings
java.lang.Object
com.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.util.MockDSExportSettings
- All Implemented Interfaces:
HasHandlers
Settings used to control the export or serialization of a
DataSource
by Reify.getMockDS()
.-
Field Summary
Fields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThecriteria
used to fetch the records returned as part of the export or serialization.Determines the format emitted byReify.getMockDS()
.boolean
Whether to include custom-definedSimpleTypes
.boolean
Shouldforeign key
relationships be included in the export or serialization of theDataSource
?boolean
Shouldimage fields
be included in the export or serialization of theDataSource
? They are excluded by default since the stored paths are unlikely to be correct when placed in any other environment, such as Reify.int
The number of levels of nodes to include, for DataSources that define atree relationship
between fields by declaring aforeignKey
on one field that refers to another from that same DataSource.int
The number of rows of data to include, if more meet thecriteria
.String[]
If includingforeign key
relationships, those relationships to skip.static MockDSExportSettings
getOrCreateRef
(JavaScriptObject jsObj) The properties that will be specified on theDSRequest
when fetching records.The properties that will be specified on theDSRequest
when fetching records.boolean
For DataSources that define atree relationship
between fields by declaring aforeignKey
on one field that refers to another from that same DataSource, shouldcriteria
be applied only to the root node? If false, the criteria will be applied to all nodes.Controls whichvalidators
, if any, to include in the fields of the exportedMockDataSource
.setCriteria
(Criteria criteria) Thecriteria
used to fetch the records returned as part of the export or serialization.setFormat
(MockDSExportFormat format) Determines the format emitted byReify.getMockDS()
.setIncludeCustomSimpleTypes
(boolean includeCustomSimpleTypes) Whether to include custom-definedSimpleTypes
.setIncludeFKs
(boolean includeFKs) Shouldforeign key
relationships be included in the export or serialization of theDataSource
?setIncludeImageFields
(boolean includeImageFields) Shouldimage fields
be included in the export or serialization of theDataSource
? They are excluded by default since the stored paths are unlikely to be correct when placed in any other environment, such as Reify.setNumLevels
(int numLevels) The number of levels of nodes to include, for DataSources that define atree relationship
between fields by declaring aforeignKey
on one field that refers to another from that same DataSource.setNumRows
(int numRows) The number of rows of data to include, if more meet thecriteria
.setOmitRelations
(String... omitRelations) If includingforeign key
relationships, those relationships to skip.setRequestProperties
(DSRequest requestProperties) The properties that will be specified on theDSRequest
when fetching records.setRequestProperties
(DSRequest... requestProperties) The properties that will be specified on theDSRequest
when fetching records.setRootCriteriaOnly
(boolean rootCriteriaOnly) For DataSources that define atree relationship
between fields by declaring aforeignKey
on one field that refers to another from that same DataSource, shouldcriteria
be applied only to the root node? If false, the criteria will be applied to all nodes.setValidatorMode
(MockDSExportValidatorMode validatorMode) Controls whichvalidators
, if any, to include in the fields of the exportedMockDataSource
.Methods inherited from class com.smartgwt.client.core.DataClass
applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
-
Constructor Details
-
MockDSExportSettings
public MockDSExportSettings() -
MockDSExportSettings
-
-
Method Details
-
getOrCreateRef
-
setCriteria
Thecriteria
used to fetch the records returned as part of the export or serialization.- Parameters:
criteria
- New criteria value. Default value is null- Returns:
MockDSExportSettings
instance, for chaining setter calls
-
getCriteria
Thecriteria
used to fetch the records returned as part of the export or serialization.- Returns:
- Current criteria value. Default value is null
-
setFormat
Determines the format emitted byReify.getMockDS()
.- Parameters:
format
- New format value. Default value is "xmlMockDS"- Returns:
MockDSExportSettings
instance, for chaining setter calls
-
getFormat
Determines the format emitted byReify.getMockDS()
.- Returns:
- Current format value. Default value is "xmlMockDS"
-
setIncludeCustomSimpleTypes
Whether to include custom-definedSimpleTypes
.- Parameters:
includeCustomSimpleTypes
- New includeCustomSimpleTypes value. Default value is false- Returns:
MockDSExportSettings
instance, for chaining setter calls
-
getIncludeCustomSimpleTypes
public boolean getIncludeCustomSimpleTypes()Whether to include custom-definedSimpleTypes
.- Returns:
- Current includeCustomSimpleTypes value. Default value is false
-
setIncludeFKs
Shouldforeign key
relationships be included in the export or serialization of theDataSource
?- Parameters:
includeFKs
- New includeFKs value. Default value is true- Returns:
MockDSExportSettings
instance, for chaining setter calls
-
getIncludeFKs
public boolean getIncludeFKs()Shouldforeign key
relationships be included in the export or serialization of theDataSource
?- Returns:
- Current includeFKs value. Default value is true
-
setIncludeImageFields
Shouldimage fields
be included in the export or serialization of theDataSource
? They are excluded by default since the stored paths are unlikely to be correct when placed in any other environment, such as Reify.- Parameters:
includeImageFields
- New includeImageFields value. Default value is false- Returns:
MockDSExportSettings
instance, for chaining setter calls
-
getIncludeImageFields
public boolean getIncludeImageFields()Shouldimage fields
be included in the export or serialization of theDataSource
? They are excluded by default since the stored paths are unlikely to be correct when placed in any other environment, such as Reify.- Returns:
- Current includeImageFields value. Default value is false
-
setNumLevels
The number of levels of nodes to include, for DataSources that define atree relationship
between fields by declaring aforeignKey
on one field that refers to another from that same DataSource.- Parameters:
numLevels
- New numLevels value. Default value is 3- Returns:
MockDSExportSettings
instance, for chaining setter calls- See Also:
-
getNumLevels
public int getNumLevels()The number of levels of nodes to include, for DataSources that define atree relationship
between fields by declaring aforeignKey
on one field that refers to another from that same DataSource.- Returns:
- Current numLevels value. Default value is 3
- See Also:
-
setNumRows
The number of rows of data to include, if more meet thecriteria
.- Parameters:
numRows
- New numRows value. Default value is 20- Returns:
MockDSExportSettings
instance, for chaining setter calls
-
getNumRows
public int getNumRows()The number of rows of data to include, if more meet thecriteria
.- Returns:
- Current numRows value. Default value is 20
-
setOmitRelations
If includingforeign key
relationships, those relationships to skip. This can be used to avoid dangling references toDataSources
that are not being exported or serialized.- Parameters:
omitRelations
- New omitRelations value. Default value is null- Returns:
MockDSExportSettings
instance, for chaining setter calls- See Also:
-
getOmitRelations
If includingforeign key
relationships, those relationships to skip. This can be used to avoid dangling references toDataSources
that are not being exported or serialized.- Returns:
- Current omitRelations value. Default value is null
- See Also:
-
setRequestProperties
The properties that will be specified on theDSRequest
when fetching records. You can pass an array of different request properties matching the length of thedsNames
param ofReify.getMockDS()
orReify.showMockDS()
if you want the fetch for eachDataSource
made with different properties.- Parameters:
requestProperties
- New requestProperties value. Default value is null- Returns:
MockDSExportSettings
instance, for chaining setter calls
-
getRequestProperties
The properties that will be specified on theDSRequest
when fetching records. You can pass an array of different request properties matching the length of thedsNames
param ofReify.getMockDS()
orReify.showMockDS()
if you want the fetch for eachDataSource
made with different properties.- Returns:
- Current requestProperties value. Default value is null
-
setRequestProperties
The properties that will be specified on theDSRequest
when fetching records. You can pass an array of different request properties matching the length of thedsNames
param ofReify.getMockDS()
orReify.showMockDS()
if you want the fetch for eachDataSource
made with different properties.- Parameters:
requestProperties
- New requestProperties value. Default value is null- Returns:
MockDSExportSettings
instance, for chaining setter calls
-
getRequestPropertiesAsDSRequest
The properties that will be specified on theDSRequest
when fetching records. You can pass an array of different request properties matching the length of thedsNames
param ofReify.getMockDS()
orReify.showMockDS()
if you want the fetch for eachDataSource
made with different properties.- Returns:
- Current requestProperties value. Default value is null
-
setRootCriteriaOnly
For DataSources that define atree relationship
between fields by declaring aforeignKey
on one field that refers to another from that same DataSource, shouldcriteria
be applied only to the root node? If false, the criteria will be applied to all nodes.- Parameters:
rootCriteriaOnly
- New rootCriteriaOnly value. Default value is false- Returns:
MockDSExportSettings
instance, for chaining setter calls- See Also:
-
getRootCriteriaOnly
public boolean getRootCriteriaOnly()For DataSources that define atree relationship
between fields by declaring aforeignKey
on one field that refers to another from that same DataSource, shouldcriteria
be applied only to the root node? If false, the criteria will be applied to all nodes.- Returns:
- Current rootCriteriaOnly value. Default value is false
- See Also:
-
setValidatorMode
Controls whichvalidators
, if any, to include in the fields of the exportedMockDataSource
. Since MockDataSources are client-only, server-only validators are not exported. Auto-generated validators are also not exported, since they will be recreated based on the type of the field during the import process.- Parameters:
validatorMode
- New validatorMode value. Default value is "standard"- Returns:
MockDSExportSettings
instance, for chaining setter calls
-
getValidatorMode
Controls whichvalidators
, if any, to include in the fields of the exportedMockDataSource
. Since MockDataSources are client-only, server-only validators are not exported. Auto-generated validators are also not exported, since they will be recreated based on the type of the field during the import process.- Returns:
- Current validatorMode value. Default value is "standard"
-