/*
 * Smart GWT (GWT for SmartClient)
 * Copyright 2008 and beyond, Isomorphic Software, Inc.
 *
 * Smart GWT is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License version 3
 * as published by the Free Software Foundation.  Smart GWT is also
 * available under typical commercial license terms - see
 * http://smartclient.com/license
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 */
/* sgwtgen */
 
package com.smartgwt.client.util;


import com.smartgwt.client.event.*;
import com.smartgwt.client.core.*;
import com.smartgwt.client.types.*;
import com.smartgwt.client.data.*;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.data.events.*;
import com.smartgwt.client.browser.window.*;
import com.smartgwt.client.rpc.*;
import com.smartgwt.client.ai.*;
import com.smartgwt.client.callbacks.*;
import com.smartgwt.client.tools.*;
import com.smartgwt.client.bean.*;
import com.smartgwt.client.widgets.*;
import com.smartgwt.client.widgets.ai.*;
import com.smartgwt.client.widgets.events.*;
import com.smartgwt.client.widgets.form.*;
import com.smartgwt.client.widgets.form.validator.*;
import com.smartgwt.client.widgets.form.fields.*;
import com.smartgwt.client.widgets.tile.*;
import com.smartgwt.client.widgets.tile.events.*;
import com.smartgwt.client.widgets.grid.*;
import com.smartgwt.client.widgets.grid.events.*;
import com.smartgwt.client.widgets.chart.*;
import com.smartgwt.client.widgets.layout.*;
import com.smartgwt.client.widgets.layout.events.*;
import com.smartgwt.client.widgets.menu.*;
import com.smartgwt.client.widgets.tour.*;
import com.smartgwt.client.widgets.notify.*;
import com.smartgwt.client.widgets.rte.*;
import com.smartgwt.client.widgets.rte.events.*;
import com.smartgwt.client.widgets.ace.*;
import com.smartgwt.client.widgets.ace.events.*;
import com.smartgwt.client.widgets.tab.*;
import com.smartgwt.client.widgets.toolbar.*;
import com.smartgwt.client.widgets.tree.*;
import com.smartgwt.client.widgets.tree.events.*;
import com.smartgwt.client.widgets.tableview.*;
import com.smartgwt.client.widgets.viewer.*;
import com.smartgwt.client.widgets.calendar.*;
import com.smartgwt.client.widgets.calendar.events.*;
import com.smartgwt.client.widgets.cube.*;
import com.smartgwt.client.widgets.notify.*;
import com.smartgwt.client.widgets.drawing.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.google.gwt.event.shared.*;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.core.client.JavaScriptObject;

import com.smartgwt.client.util.*;
import com.smartgwt.client.util.events.*;
import com.smartgwt.client.util.workflow.*;
import com.smartgwt.client.util.workflow.Process; // required to override java.lang.Process
import com.smartgwt.client.util.tour.*;


/**
 * Settings used to control the export or serialization of a {@link com.smartgwt.client.data.DataSource} by {@link
 * com.smartgwt.client.tools.Reify#getMockDS Reify.getMockDS()}.
 */
@BeanFactory.FrameworkClass
public class MockDSExportSettings extends DataClass {

    public static MockDSExportSettings getOrCreateRef(JavaScriptObject jsObj) {
        if(jsObj == null) return null;
        return new MockDSExportSettings(jsObj);
    }
        


    public MockDSExportSettings(){
        
    }

    public MockDSExportSettings(JavaScriptObject jsObj){
        
        setJavaScriptObject(jsObj);
    }



    // ********************* Properties / Attributes ***********************

    /**
     * The {@link com.smartgwt.client.data.Criteria criteria} used to fetch the records returned as part of the export or
     * serialization.
     *
     * @param criteria New criteria value. Default value is null
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     */
    public MockDSExportSettings setCriteria(Criteria criteria) {
        if (criteria instanceof Criterion) {
            criteria.setAttribute("_constructor", "AdvancedCriteria");
        }
        return (MockDSExportSettings)setAttribute("criteria", criteria == null ? null : criteria.getJsObj());
    }

    /**
     * The {@link com.smartgwt.client.data.Criteria criteria} used to fetch the records returned as part of the export or
     * serialization.
     *
     * @return Current criteria value. Default value is null
     */
    public Criteria getCriteria()  {
        return new Criteria(getAttributeAsJavaScriptObject("criteria"));
    }
    

    /**
     * When true, fields whose values are <code>null</code> or <code>undefined</code> in every fetched record are completely
     * omitted from the exported {@link com.smartgwt.client.data.MockDataSource} ? both the field declaration and the
     * corresponding record property are dropped. This produces a compact schema containing only fields that carry actual data,
     * which is ideal for reporting demos and other contexts where schema noise should be minimized. <P> Primary-key and
     * foreign-key fields are always retained regardless of data content, since they are structurally required. <P> This
     * setting is stronger than {@link com.smartgwt.client.util.MockDSExportSettings#getHideEmptyFields hideEmptyFields}: when
     * both are true, <code>dropEmptyFields</code> takes precedence and empty fields are removed rather than merely demoted to
     * <code>detail:true</code>.
     *
     * @param dropEmptyFields New dropEmptyFields value. Default value is false
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     * @see com.smartgwt.client.util.MockDSExportSettings#setHideEmptyFields
     */
    public MockDSExportSettings setDropEmptyFields(boolean dropEmptyFields) {
        return (MockDSExportSettings)setAttribute("dropEmptyFields", dropEmptyFields);
    }

    /**
     * When true, fields whose values are <code>null</code> or <code>undefined</code> in every fetched record are completely
     * omitted from the exported {@link com.smartgwt.client.data.MockDataSource} ? both the field declaration and the
     * corresponding record property are dropped. This produces a compact schema containing only fields that carry actual data,
     * which is ideal for reporting demos and other contexts where schema noise should be minimized. <P> Primary-key and
     * foreign-key fields are always retained regardless of data content, since they are structurally required. <P> This
     * setting is stronger than {@link com.smartgwt.client.util.MockDSExportSettings#getHideEmptyFields hideEmptyFields}: when
     * both are true, <code>dropEmptyFields</code> takes precedence and empty fields are removed rather than merely demoted to
     * <code>detail:true</code>.
     *
     * @return Current dropEmptyFields value. Default value is false
     * @see com.smartgwt.client.util.MockDSExportSettings#getHideEmptyFields
     */
    public boolean getDropEmptyFields()  {
        Boolean result = getAttributeAsBoolean("dropEmptyFields", true);
        return result == null ? false : result;
    }
    

    /**
     * When non-zero, automatically discovers {@link com.smartgwt.client.data.DataSource DataSources} reachable from the
     * explicitly requested DataSources via {@link com.smartgwt.client.data.DataSourceField#getForeignKey foreignKey}
     * relationships, up to this many hops.  A value of 1 adds DataSources directly referenced by a foreignKey on any requested
     * DataSource; a value of 2 additionally adds DataSources referenced by those, and so on. <P> This is useful when exporting
     * a set of interlinked DataSources and you want to automatically include all related DataSources without enumerating them
     * manually. The traversal walks both directions: from a field's <code>foreignKey</code> to the target DataSource, and from
     * a target DataSource back to any DataSource that references it.  Self-referential (tree) FKs are not counted as a hop.
     *
     * @param followFKDepth New followFKDepth value. Default value is 0
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     */
    public MockDSExportSettings setFollowFKDepth(int followFKDepth) {
        return (MockDSExportSettings)setAttribute("followFKDepth", followFKDepth);
    }

    /**
     * When non-zero, automatically discovers {@link com.smartgwt.client.data.DataSource DataSources} reachable from the
     * explicitly requested DataSources via {@link com.smartgwt.client.data.DataSourceField#getForeignKey foreignKey}
     * relationships, up to this many hops.  A value of 1 adds DataSources directly referenced by a foreignKey on any requested
     * DataSource; a value of 2 additionally adds DataSources referenced by those, and so on. <P> This is useful when exporting
     * a set of interlinked DataSources and you want to automatically include all related DataSources without enumerating them
     * manually. The traversal walks both directions: from a field's <code>foreignKey</code> to the target DataSource, and from
     * a target DataSource back to any DataSource that references it.  Self-referential (tree) FKs are not counted as a hop.
     *
     * @return Current followFKDepth value. Default value is 0
     */
    public int getFollowFKDepth()  {
        return getAttributeAsInt("followFKDepth");
    }
    

    /**
     * Determines the format emitted by {@link com.smartgwt.client.tools.Reify#getMockDS Reify.getMockDS()}.
     *
     * @param format New format value. Default value is "xmlMockDS"
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     */
    public MockDSExportSettings setFormat(MockDSExportFormat format) {
        return (MockDSExportSettings)setAttribute("format", format == null ? null : format.getValue());
    }

    /**
     * Determines the format emitted by {@link com.smartgwt.client.tools.Reify#getMockDS Reify.getMockDS()}.
     *
     * @return Current format value. Default value is "xmlMockDS"
     */
    public MockDSExportFormat getFormat()  {
        return EnumUtil.getEnum(MockDSExportFormat.values(), getAttribute("format"));
    }
    

    /**
     * When true, fields whose values are <code>null</code> or <code>undefined</code> in every fetched record are automatically
     * marked {@link com.smartgwt.client.data.DataSourceField#getDetail detail}:<code>true</code> in the exported {@link
     * com.smartgwt.client.data.MockDataSource}.  This keeps structurally important fields (primary keys and foreign keys)
     * visible regardless of data content, while demoting columns that carry no data so they don't clutter default views. <P>
     * See also {@link com.smartgwt.client.util.MockDSExportSettings#getDropEmptyFields dropEmptyFields} to fully remove empty
     * fields from the exported schema and record data.
     *
     * @param hideEmptyFields New hideEmptyFields value. Default value is false
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     * @see com.smartgwt.client.util.MockDSExportSettings#setDropEmptyFields
     */
    public MockDSExportSettings setHideEmptyFields(boolean hideEmptyFields) {
        return (MockDSExportSettings)setAttribute("hideEmptyFields", hideEmptyFields);
    }

    /**
     * When true, fields whose values are <code>null</code> or <code>undefined</code> in every fetched record are automatically
     * marked {@link com.smartgwt.client.data.DataSourceField#getDetail detail}:<code>true</code> in the exported {@link
     * com.smartgwt.client.data.MockDataSource}.  This keeps structurally important fields (primary keys and foreign keys)
     * visible regardless of data content, while demoting columns that carry no data so they don't clutter default views. <P>
     * See also {@link com.smartgwt.client.util.MockDSExportSettings#getDropEmptyFields dropEmptyFields} to fully remove empty
     * fields from the exported schema and record data.
     *
     * @return Current hideEmptyFields value. Default value is false
     * @see com.smartgwt.client.util.MockDSExportSettings#getDropEmptyFields
     */
    public boolean getHideEmptyFields()  {
        Boolean result = getAttributeAsBoolean("hideEmptyFields", true);
        return result == null ? false : result;
    }
    

    /**
     * Whether to include custom-defined {@link com.smartgwt.client.data.SimpleType SimpleTypes}.
     *
     * @param includeCustomSimpleTypes New includeCustomSimpleTypes value. Default value is false
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     */
    public MockDSExportSettings setIncludeCustomSimpleTypes(boolean includeCustomSimpleTypes) {
        return (MockDSExportSettings)setAttribute("includeCustomSimpleTypes", includeCustomSimpleTypes);
    }

    /**
     * Whether to include custom-defined {@link com.smartgwt.client.data.SimpleType SimpleTypes}.
     *
     * @return Current includeCustomSimpleTypes value. Default value is false
     */
    public boolean getIncludeCustomSimpleTypes()  {
        Boolean result = getAttributeAsBoolean("includeCustomSimpleTypes", true);
        return result == null ? false : result;
    }
    

    /**
     * Should {@link com.smartgwt.client.data.DataSourceField#getForeignKey foreign key} relationships be included in the
     * export or serialization of the {@link com.smartgwt.client.data.DataSource}?
     *
     * @param includeFKs New includeFKs value. Default value is true
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     */
    public MockDSExportSettings setIncludeFKs(boolean includeFKs) {
        return (MockDSExportSettings)setAttribute("includeFKs", includeFKs);
    }

    /**
     * Should {@link com.smartgwt.client.data.DataSourceField#getForeignKey foreign key} relationships be included in the
     * export or serialization of the {@link com.smartgwt.client.data.DataSource}?
     *
     * @return Current includeFKs value. Default value is true
     */
    public boolean getIncludeFKs()  {
        Boolean result = getAttributeAsBoolean("includeFKs", true);
        return result == null ? true : result;
    }
    

    /**
     * Should {@link com.smartgwt.client.docs.serverds.DataSourceField#includeFrom DataSourceField.includeFrom} declarations be
     * preserved in the exported {@link com.smartgwt.client.data.MockDataSource}?  When <code>true</code>, the export
     * reconstructs <code>includeFrom</code> paths from the server-resolved field metadata so the clientOnly DataSource can
     * resolve cross-DS field lookups at runtime.
     *
     * @param includeFrom New includeFrom value. Default value is true
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     * @see com.smartgwt.client.util.MockDSExportSettings#setIncludeFKs
     */
    public MockDSExportSettings setIncludeFrom(boolean includeFrom) {
        return (MockDSExportSettings)setAttribute("includeFrom", includeFrom);
    }

    /**
     * Should {@link com.smartgwt.client.docs.serverds.DataSourceField#includeFrom DataSourceField.includeFrom} declarations be
     * preserved in the exported {@link com.smartgwt.client.data.MockDataSource}?  When <code>true</code>, the export
     * reconstructs <code>includeFrom</code> paths from the server-resolved field metadata so the clientOnly DataSource can
     * resolve cross-DS field lookups at runtime.
     *
     * @return Current includeFrom value. Default value is true
     * @see com.smartgwt.client.util.MockDSExportSettings#getIncludeFKs
     */
    public boolean getIncludeFrom()  {
        Boolean result = getAttributeAsBoolean("includeFrom", true);
        return result == null ? true : result;
    }
    

    /**
     * Should {@link com.smartgwt.client.types.FieldType image fields} be included in the export or serialization of the {@link
     * com.smartgwt.client.data.DataSource}?  They are excluded by default since the stored paths are unlikely to be correct
     * when placed in any other environment, such as Reify.
     *
     * @param includeImageFields New includeImageFields value. Default value is false
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     */
    public MockDSExportSettings setIncludeImageFields(boolean includeImageFields) {
        return (MockDSExportSettings)setAttribute("includeImageFields", includeImageFields);
    }

    /**
     * Should {@link com.smartgwt.client.types.FieldType image fields} be included in the export or serialization of the {@link
     * com.smartgwt.client.data.DataSource}?  They are excluded by default since the stored paths are unlikely to be correct
     * when placed in any other environment, such as Reify.
     *
     * @return Current includeImageFields value. Default value is false
     */
    public boolean getIncludeImageFields()  {
        Boolean result = getAttributeAsBoolean("includeImageFields", true);
        return result == null ? false : result;
    }
    

    /**
     * When true, foreign-key declarations whose target {@link com.smartgwt.client.data.DataSource} is not in the set of
     * DataSources being exported are automatically stripped from the output.  This prevents the exported file from containing
     * dangling FK references to DataSources that do not exist at runtime, which would cause inner-join filtering to silently
     * drop records and generate console warnings. <P> This is a convenient alternative to manually enumerating many {@link
     * com.smartgwt.client.util.MockDSExportSettings#getOmitRelations omitRelations} entries when the export set is a small
     * subset of a large interconnected schema.
     *
     * @param localFKsOnly New localFKsOnly value. Default value is false
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     * @see com.smartgwt.client.util.MockDSExportSettings#setOmitRelations
     * @see com.smartgwt.client.util.MockDSExportSettings#setIncludeFKs
     */
    public MockDSExportSettings setLocalFKsOnly(boolean localFKsOnly) {
        return (MockDSExportSettings)setAttribute("localFKsOnly", localFKsOnly);
    }

    /**
     * When true, foreign-key declarations whose target {@link com.smartgwt.client.data.DataSource} is not in the set of
     * DataSources being exported are automatically stripped from the output.  This prevents the exported file from containing
     * dangling FK references to DataSources that do not exist at runtime, which would cause inner-join filtering to silently
     * drop records and generate console warnings. <P> This is a convenient alternative to manually enumerating many {@link
     * com.smartgwt.client.util.MockDSExportSettings#getOmitRelations omitRelations} entries when the export set is a small
     * subset of a large interconnected schema.
     *
     * @return Current localFKsOnly value. Default value is false
     * @see com.smartgwt.client.util.MockDSExportSettings#getOmitRelations
     * @see com.smartgwt.client.util.MockDSExportSettings#getIncludeFKs
     */
    public boolean getLocalFKsOnly()  {
        Boolean result = getAttributeAsBoolean("localFKsOnly", true);
        return result == null ? false : result;
    }
    

    /**
     * When a self-referential {@link com.smartgwt.client.data.DataSourceField#getForeignKey foreign\n key} is detected, an
     * exploratory fetch counts the root nodes before committing to tree-style multi-level fetching.  If there are more root
     * nodes than <code>maxTreeRoots</code>, the DataSource is exported as a flat table with the standard {@link
     * com.smartgwt.client.util.MockDSExportSettings#getNumRows numRows} limit instead. <P> This prevents unbounded queries on
     * DataSources where a self-FK is not a true tree hierarchy.  Common cases include an orders table where most orders are
     * roots (not created from a quotation), or an employees table where a "referred by" self-FK yields thousands of unlinked
     * root nodes. <P> Set to <code>null</code> to disable the exploratory check entirely.
     *
     * @param maxTreeRoots New maxTreeRoots value. Default value is 500
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     * @see com.smartgwt.client.util.MockDSExportSettings#setNonTreeDataSources
     * @see com.smartgwt.client.util.MockDSExportSettings#setNumLevels
     */
    public MockDSExportSettings setMaxTreeRoots(int maxTreeRoots) {
        return (MockDSExportSettings)setAttribute("maxTreeRoots", maxTreeRoots);
    }

    /**
     * When a self-referential {@link com.smartgwt.client.data.DataSourceField#getForeignKey foreign\n key} is detected, an
     * exploratory fetch counts the root nodes before committing to tree-style multi-level fetching.  If there are more root
     * nodes than <code>maxTreeRoots</code>, the DataSource is exported as a flat table with the standard {@link
     * com.smartgwt.client.util.MockDSExportSettings#getNumRows numRows} limit instead. <P> This prevents unbounded queries on
     * DataSources where a self-FK is not a true tree hierarchy.  Common cases include an orders table where most orders are
     * roots (not created from a quotation), or an employees table where a "referred by" self-FK yields thousands of unlinked
     * root nodes. <P> Set to <code>null</code> to disable the exploratory check entirely.
     *
     * @return Current maxTreeRoots value. Default value is 500
     * @see com.smartgwt.client.util.MockDSExportSettings#getNonTreeDataSources
     * @see com.smartgwt.client.util.MockDSExportSettings#getNumLevels
     */
    public int getMaxTreeRoots()  {
        return getAttributeAsInt("maxTreeRoots");
    }
    

    /**
     * {@link com.smartgwt.client.data.DataSource#getID IDs} of DataSources that should not be treated as {@link
     * com.smartgwt.client.docs.TreeDataBinding tree DataSources} despite having self-referential {@link
     * com.smartgwt.client.data.DataSourceField#getForeignKey foreign\n keys}.  Self-FKs on these DataSources are preserved in
     * the exported schema but do not trigger the automatic multi-level tree fetching that normally occurs when a self-FK is
     * detected. <P> Use this when a self-referential FK represents a data relationship rather than a parent-child hierarchy ?
     * for example, a sales order referencing the quotation it was created from, or an employee referencing the colleague who
     * referred them.  In these cases, tree fetching would issue an unbounded root-node query covering most of the table. <P>
     * See also {@link com.smartgwt.client.util.MockDSExportSettings#getMaxTreeRoots maxTreeRoots}, which detects these cases
     * automatically without requiring you to enumerate DataSources.
     *
     * @param nonTreeDataSources New nonTreeDataSources value. Default value is null
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     * @see com.smartgwt.client.util.MockDSExportSettings#setMaxTreeRoots
     */
    public MockDSExportSettings setNonTreeDataSources(String... nonTreeDataSources) {
        return (MockDSExportSettings)setAttribute("nonTreeDataSources", nonTreeDataSources);
    }

    /**
     * {@link com.smartgwt.client.data.DataSource#getID IDs} of DataSources that should not be treated as {@link
     * com.smartgwt.client.docs.TreeDataBinding tree DataSources} despite having self-referential {@link
     * com.smartgwt.client.data.DataSourceField#getForeignKey foreign\n keys}.  Self-FKs on these DataSources are preserved in
     * the exported schema but do not trigger the automatic multi-level tree fetching that normally occurs when a self-FK is
     * detected. <P> Use this when a self-referential FK represents a data relationship rather than a parent-child hierarchy ?
     * for example, a sales order referencing the quotation it was created from, or an employee referencing the colleague who
     * referred them.  In these cases, tree fetching would issue an unbounded root-node query covering most of the table. <P>
     * See also {@link com.smartgwt.client.util.MockDSExportSettings#getMaxTreeRoots maxTreeRoots}, which detects these cases
     * automatically without requiring you to enumerate DataSources.
     *
     * @return Current nonTreeDataSources value. Default value is null
     * @see com.smartgwt.client.util.MockDSExportSettings#getMaxTreeRoots
     */
    public String[] getNonTreeDataSources()  {
        return com.smartgwt.client.util.ConvertTo.arrayOfString(getAttributeAsJavaScriptObject("nonTreeDataSources"));
    }
    

    /**
     * The number of levels of nodes to include, for DataSources that define a {@link com.smartgwt.client.docs.TreeDataBinding
     * tree relationship} between fields by declaring a {@link com.smartgwt.client.data.DataSourceField#getForeignKey
     * foreignKey} on one field that refers to another from that same DataSource.
     *
     * @param numLevels New numLevels value. Default value is 3
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     * @see com.smartgwt.client.util.MockDSExportSettings#setRootCriteriaOnly
     */
    public MockDSExportSettings setNumLevels(int numLevels) {
        return (MockDSExportSettings)setAttribute("numLevels", numLevels);
    }

    /**
     * The number of levels of nodes to include, for DataSources that define a {@link com.smartgwt.client.docs.TreeDataBinding
     * tree relationship} between fields by declaring a {@link com.smartgwt.client.data.DataSourceField#getForeignKey
     * foreignKey} on one field that refers to another from that same DataSource.
     *
     * @return Current numLevels value. Default value is 3
     * @see com.smartgwt.client.util.MockDSExportSettings#getRootCriteriaOnly
     */
    public int getNumLevels()  {
        return getAttributeAsInt("numLevels");
    }
    

    /**
     * The number of rows of data to include, if more meet the {@link com.smartgwt.client.util.MockDSExportSettings#getCriteria
     * criteria}.
     *
     * @param numRows New numRows value. Default value is 20
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     */
    public MockDSExportSettings setNumRows(int numRows) {
        return (MockDSExportSettings)setAttribute("numRows", numRows);
    }

    /**
     * The number of rows of data to include, if more meet the {@link com.smartgwt.client.util.MockDSExportSettings#getCriteria
     * criteria}.
     *
     * @return Current numRows value. Default value is 20
     */
    public int getNumRows()  {
        return getAttributeAsInt("numRows");
    }
    

    /**
     * {@link com.smartgwt.client.data.DataSourceField#getForeignKey Foreign key} relationships to exclude from the dependency
     * graph that determines fetch order and relation criteria. Omitted FKs do not generate dependency-chain fetch criteria,
     * but FK declarations are still preserved in the exported schema so that {@link
     * com.smartgwt.client.data.DataSourceField#getForeignDisplayField DataSourceField.foreignDisplayField} and {@link
     * com.smartgwt.client.data.DataSourceField#getDisplayField DataSourceField.displayField} can resolve display values at
     * runtime from the related {@link com.smartgwt.client.data.MockDataSource}'s {@link
     * com.smartgwt.client.data.DataSource#getCacheData cacheData}.  To fully strip FK declarations for DataSources not in the
     * export set, use {@link com.smartgwt.client.util.MockDSExportSettings#getLocalFKsOnly localFKsOnly} instead. <P> Entries
     * can use either of two formats: <ul> <li><b>targetDS.targetField</b> &ndash; omits <i>every</i> FK that     references
     * that target, from any DataSource.  Use this for     lookup/reference tables whose broad criteria would dilute the    
     * dependency chain.</li> <li><b>sourceDS.sourceField</b> &ndash; omits only the named     field's FK on the named
     * DataSource, leaving other DataSources'     references to the same target intact.  Use this to break     circular FK
     * dependencies.</li> </ul>
     *
     * @param omitRelations New omitRelations value. Default value is null
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     * @see com.smartgwt.client.util.MockDSExportSettings#setIncludeFKs
     */
    public MockDSExportSettings setOmitRelations(String... omitRelations) {
        return (MockDSExportSettings)setAttribute("omitRelations", omitRelations);
    }

    /**
     * {@link com.smartgwt.client.data.DataSourceField#getForeignKey Foreign key} relationships to exclude from the dependency
     * graph that determines fetch order and relation criteria. Omitted FKs do not generate dependency-chain fetch criteria,
     * but FK declarations are still preserved in the exported schema so that {@link
     * com.smartgwt.client.data.DataSourceField#getForeignDisplayField DataSourceField.foreignDisplayField} and {@link
     * com.smartgwt.client.data.DataSourceField#getDisplayField DataSourceField.displayField} can resolve display values at
     * runtime from the related {@link com.smartgwt.client.data.MockDataSource}'s {@link
     * com.smartgwt.client.data.DataSource#getCacheData cacheData}.  To fully strip FK declarations for DataSources not in the
     * export set, use {@link com.smartgwt.client.util.MockDSExportSettings#getLocalFKsOnly localFKsOnly} instead. <P> Entries
     * can use either of two formats: <ul> <li><b>targetDS.targetField</b> &ndash; omits <i>every</i> FK that     references
     * that target, from any DataSource.  Use this for     lookup/reference tables whose broad criteria would dilute the    
     * dependency chain.</li> <li><b>sourceDS.sourceField</b> &ndash; omits only the named     field's FK on the named
     * DataSource, leaving other DataSources'     references to the same target intact.  Use this to break     circular FK
     * dependencies.</li> </ul>
     *
     * @return Current omitRelations value. Default value is null
     * @see com.smartgwt.client.util.MockDSExportSettings#getIncludeFKs
     */
    public String[] getOmitRelations()  {
        return com.smartgwt.client.util.ConvertTo.arrayOfString(getAttributeAsJavaScriptObject("omitRelations"));
    }
    

    /**
     * An object mapping {@link com.smartgwt.client.data.DataSource#getID DataSource IDs} to {@link
     * com.smartgwt.client.data.Criteria} that should be applied when fetching records for that DataSource.  The criteria are
     * combined with any global {@link com.smartgwt.client.data.Criteria} and any relation-derived criteria using {@link
     * com.smartgwt.client.data.DataSource#combineCriteria DataSource.combineCriteria()}. <P> For tree DataSources, per-DS
     * criteria are applied to <b>every</b> level of the tree fetch.  To restrict only which roots are fetched while allowing
     * unrestricted child expansion, use {@link com.smartgwt.client.util.MockDSExportSettings#getTreeRoots treeRoots} instead.
     *
     * @param perDSCriteria New perDSCriteria value. Default value is null
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     * @see com.smartgwt.client.data.Criteria
     * @see com.smartgwt.client.util.MockDSExportSettings#setTreeRoots
     */
    public MockDSExportSettings setPerDSCriteria(Map perDSCriteria) {
        return (MockDSExportSettings)setAttribute("perDSCriteria", perDSCriteria);
    }

    /**
     * An object mapping {@link com.smartgwt.client.data.DataSource#getID DataSource IDs} to {@link
     * com.smartgwt.client.data.Criteria} that should be applied when fetching records for that DataSource.  The criteria are
     * combined with any global {@link com.smartgwt.client.data.Criteria} and any relation-derived criteria using {@link
     * com.smartgwt.client.data.DataSource#combineCriteria DataSource.combineCriteria()}. <P> For tree DataSources, per-DS
     * criteria are applied to <b>every</b> level of the tree fetch.  To restrict only which roots are fetched while allowing
     * unrestricted child expansion, use {@link com.smartgwt.client.util.MockDSExportSettings#getTreeRoots treeRoots} instead.
     *
     * @return Current perDSCriteria value. Default value is null
     * @see com.smartgwt.client.data.Criteria
     * @see com.smartgwt.client.util.MockDSExportSettings#getTreeRoots
     */
    public Map getPerDSCriteria()  {
        return getAttributeAsMap("perDSCriteria");
    }
    

    /**
     * The properties that will be specified on the {@link com.smartgwt.client.data.DSRequest} when fetching records. You can
     * pass an array of different request properties matching the length of the <code>dsNames</code> param of {@link
     * com.smartgwt.client.tools.Reify#getMockDS Reify.getMockDS()} or {@link com.smartgwt.client.tools.Reify#showMockDS
     * Reify.showMockDS()} if you want the fetch for each {@link com.smartgwt.client.data.DataSource} made with different
     * properties.
     *
     * @param requestProperties New requestProperties value. Default value is null
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     */
    public MockDSExportSettings setRequestProperties(DSRequest... requestProperties) {
        return (MockDSExportSettings)setAttribute("requestProperties", requestProperties);
    }

    /**
     * The properties that will be specified on the {@link com.smartgwt.client.data.DSRequest} when fetching records. You can
     * pass an array of different request properties matching the length of the <code>dsNames</code> param of {@link
     * com.smartgwt.client.tools.Reify#getMockDS Reify.getMockDS()} or {@link com.smartgwt.client.tools.Reify#showMockDS
     * Reify.showMockDS()} if you want the fetch for each {@link com.smartgwt.client.data.DataSource} made with different
     * properties.
     *
     * @return Current requestProperties value. Default value is null
     */
    public DSRequest[] getRequestProperties()  {
        return com.smartgwt.client.util.ConvertTo.arrayOfDSRequest(getAttributeAsJavaScriptObject("requestProperties"));
    }

    /**
     * The properties that will be specified on the {@link com.smartgwt.client.data.DSRequest} when fetching records. You can
     * pass an array of different request properties matching the length of the <code>dsNames</code> param of {@link
     * com.smartgwt.client.tools.Reify#getMockDS Reify.getMockDS()} or {@link com.smartgwt.client.tools.Reify#showMockDS
     * Reify.showMockDS()} if you want the fetch for each {@link com.smartgwt.client.data.DataSource} made with different
     * properties.
     *
     * @param requestProperties New requestProperties value. Default value is null
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     */
    public MockDSExportSettings setRequestProperties(DSRequest requestProperties) {
        JavaScriptObject config = requestProperties == null ? null : requestProperties.getJsObj();
        return (MockDSExportSettings)setAttribute("requestProperties", JSOHelper.cleanProperties(config, true));
    }

    /**
     * The properties that will be specified on the {@link com.smartgwt.client.data.DSRequest} when fetching records. You can
     * pass an array of different request properties matching the length of the <code>dsNames</code> param of {@link
     * com.smartgwt.client.tools.Reify#getMockDS Reify.getMockDS()} or {@link com.smartgwt.client.tools.Reify#showMockDS
     * Reify.showMockDS()} if you want the fetch for each {@link com.smartgwt.client.data.DataSource} made with different
     * properties.
     *
     * @return Current requestProperties value. Default value is null
     */
    public DSRequest getRequestPropertiesAsDSRequest()  {
        return DSRequest.getOrCreateRef(getAttributeAsJavaScriptObject("requestProperties"));
    }
    

    /**
     * For DataSources that define a {@link com.smartgwt.client.docs.TreeDataBinding tree relationship} between fields by
     * declaring a {@link com.smartgwt.client.data.DataSourceField#getForeignKey foreignKey} on one field that refers to
     * another from that same DataSource, should {@link com.smartgwt.client.util.MockDSExportSettings#getCriteria criteria} be
     * applied only to the root node?  If false, the criteria will be applied to all nodes.
     *
     * @param rootCriteriaOnly New rootCriteriaOnly value. Default value is false
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     * @see com.smartgwt.client.util.MockDSExportSettings#setNumLevels
     */
    public MockDSExportSettings setRootCriteriaOnly(boolean rootCriteriaOnly) {
        return (MockDSExportSettings)setAttribute("rootCriteriaOnly", rootCriteriaOnly);
    }

    /**
     * For DataSources that define a {@link com.smartgwt.client.docs.TreeDataBinding tree relationship} between fields by
     * declaring a {@link com.smartgwt.client.data.DataSourceField#getForeignKey foreignKey} on one field that refers to
     * another from that same DataSource, should {@link com.smartgwt.client.util.MockDSExportSettings#getCriteria criteria} be
     * applied only to the root node?  If false, the criteria will be applied to all nodes.
     *
     * @return Current rootCriteriaOnly value. Default value is false
     * @see com.smartgwt.client.util.MockDSExportSettings#getNumLevels
     */
    public boolean getRootCriteriaOnly()  {
        Boolean result = getAttributeAsBoolean("rootCriteriaOnly", true);
        return result == null ? false : result;
    }
    

    /**
     * When <code>true</code>, fetches records from each {@link com.smartgwt.client.data.DataSource} one at a time rather than
     * batching all independent fetches into a single queued request.  This is recommended when exporting from large production
     * databases where concurrent queries can exhaust connection pools.  See the {@link
     * com.smartgwt.client.docs.LargeDatabaseExport Large Database Export} overview for guidance.
     *
     * @param sequentialFetching New sequentialFetching value. Default value is false
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     * @see com.smartgwt.client.util.MockDSExportSettings#setNonTreeDataSources
     * @see com.smartgwt.client.util.MockDSExportSettings#setMaxTreeRoots
     */
    public MockDSExportSettings setSequentialFetching(boolean sequentialFetching) {
        return (MockDSExportSettings)setAttribute("sequentialFetching", sequentialFetching);
    }

    /**
     * When <code>true</code>, fetches records from each {@link com.smartgwt.client.data.DataSource} one at a time rather than
     * batching all independent fetches into a single queued request.  This is recommended when exporting from large production
     * databases where concurrent queries can exhaust connection pools.  See the {@link
     * com.smartgwt.client.docs.LargeDatabaseExport Large Database Export} overview for guidance.
     *
     * @return Current sequentialFetching value. Default value is false
     * @see com.smartgwt.client.util.MockDSExportSettings#getNonTreeDataSources
     * @see com.smartgwt.client.util.MockDSExportSettings#getMaxTreeRoots
     */
    public boolean getSequentialFetching()  {
        Boolean result = getAttributeAsBoolean("sequentialFetching", true);
        return result == null ? false : result;
    }
    

    /**
     * An object mapping {@link com.smartgwt.client.data.DataSource#getID DataSource IDs} to
     *  arrays of primary key values identifying the specific root
     *  nodes to include for tree DataSources.  Unlike
     * {@link com.smartgwt.client.util.MockDSExportSettings#getPerDSCriteria perDSCriteria}, which filters every level of the
     * tree,
     *  <code>treeRoots</code> restricts only the initial root-level
     *  fetch ? child nodes under the specified roots are fetched
     *  without the root restriction.
     *  <P>
     *  This is useful when you want a complete subtree under specific
     *  known roots.  For example, to export only the "Electronics"
     *  and "Clothing" product category trees:
     *  <pre>
     *    treeRoots: { productCategory: ["electronics", "clothing"] }
     *  </pre>
     *
     * @param treeRoots New treeRoots value. Default value is null
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     * @see com.smartgwt.client.util.MockDSExportSettings#setPerDSCriteria
     * @see com.smartgwt.client.util.MockDSExportSettings#setNumLevels
     */
    public MockDSExportSettings setTreeRoots(Map treeRoots) {
        return (MockDSExportSettings)setAttribute("treeRoots", treeRoots);
    }

    /**
     * An object mapping {@link com.smartgwt.client.data.DataSource#getID DataSource IDs} to
     *  arrays of primary key values identifying the specific root
     *  nodes to include for tree DataSources.  Unlike
     * {@link com.smartgwt.client.util.MockDSExportSettings#getPerDSCriteria perDSCriteria}, which filters every level of the
     * tree,
     *  <code>treeRoots</code> restricts only the initial root-level
     *  fetch ? child nodes under the specified roots are fetched
     *  without the root restriction.
     *  <P>
     *  This is useful when you want a complete subtree under specific
     *  known roots.  For example, to export only the "Electronics"
     *  and "Clothing" product category trees:
     *  <pre>
     *    treeRoots: { productCategory: ["electronics", "clothing"] }
     *  </pre>
     *
     * @return Current treeRoots value. Default value is null
     * @see com.smartgwt.client.util.MockDSExportSettings#getPerDSCriteria
     * @see com.smartgwt.client.util.MockDSExportSettings#getNumLevels
     */
    public Map getTreeRoots()  {
        return getAttributeAsMap("treeRoots");
    }
    

    /**
     * Controls which {@link com.smartgwt.client.widgets.form.validator.Validator validators}, if any, to include in the fields
     * of the exported {@link com.smartgwt.client.data.MockDataSource}.  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.
     *
     * @param validatorMode New validatorMode value. Default value is "standard"
     * @return {@link com.smartgwt.client.util.MockDSExportSettings MockDSExportSettings} instance, for chaining setter calls
     */
    public MockDSExportSettings setValidatorMode(MockDSExportValidatorMode validatorMode) {
        return (MockDSExportSettings)setAttribute("validatorMode", validatorMode == null ? null : validatorMode.getValue());
    }

    /**
     * Controls which {@link com.smartgwt.client.widgets.form.validator.Validator validators}, if any, to include in the fields
     * of the exported {@link com.smartgwt.client.data.MockDataSource}.  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.
     *
     * @return Current validatorMode value. Default value is "standard"
     */
    public MockDSExportValidatorMode getValidatorMode()  {
        return EnumUtil.getEnum(MockDSExportValidatorMode.values(), getAttribute("validatorMode"));
    }
    

    // ********************* Methods ***********************

    // ********************* Static Methods ***********************

    // ***********************************************************

}
