if (window.isc == undefined || window.isc.DataSource == undefined){  alert("Can't load DataSources - SmartClient runtime not loaded");}isc.DataSource.create({
    restrictPublisher:"false",
    allowAdvancedCriteria:true,
    xpaths:"EXPORTCOUNT~size(codeBatchDownloads);",
    linkedDataMethods:"getPkid;getName;getPublisherString;getCreationDate;getModificationDate;getPublisherBillingString;         getGeneratedCount;getRequestCount;getRedemptionCount;getLastRedemptionDate;getDescription;getBatchReference;         getPublisherStringsLob;         CREATED_BY_FULLNAME|getCreatedBy-getFullName;FACTORYPKID|getCodeFactory-getPkid;getHidden;         LASTEXPORTBY|getLastExportedByUser-getLogin;getLastExportDate;         BATCHCOMMENTS|getComments;getComments",
    mappedBeanClass:"com.paceap.eden.jpa.main.CodeBatch",
    mappedFieldTypes:"FACTORYPKID|java.lang.Long",
    ID:"code_factory_batch_DS_HibernateORM",
    dropExtraFields:true,
    fields:[
        {
            name:"PKID",
            hidden:true,
            type:"integer",
            primaryKey:true
        },
        {
            name:"NAME",
            width:"350",
            title:"Batch Name",
            type:"text"
        },
        {
            showHintInField:"false",
            hint:"This is the name which will be shown in your factory batch and</br>will be applied to every code",
            name:"BATCHNAME",
            width:"350",
            title:"Batch Name",
            type:"text"
        },
        {
            showHintInField:"true",
            hint:"Please type your comments",
            name:"COMMENTS",
            width:"915",
            title:"",
            type:"textArea",
            height:"100"
        },
        {
            showHintInField:"true",
            hint:"Please type your comments",
            name:"BATCHCOMMENTS",
            width:"915",
            title:"",
            type:"textArea",
            height:"100"
        },
        {
            showHintInField:"false",
            hint:"This data will be applied to EVERY code, as a separate field from the Batch Reference",
            name:"PUBLISHERSTRING",
            width:"350",
            title:"Additional information",
            type:"text"
        },
        {
            hidden:true,
            showHintInField:"false",
            name:"PUBLISHERSTRINGSLOB",
            width:"350",
            title:"Upload Data File",
            type:"text"
        },
        {
            name:"BATCHREFERENCE",
            title:"Batch Reference",
            type:"text"
        },
        {
            name:"UPLOADDATA",
            title:"Upload data file",
            type:"text",
            showHintInField:"false",
            hint:"Use this to add extra data to eah individual code (sent to you when redeemed)"
        },
        {
            name:"DESCRIPTION",
            width:"350",
            title:"Description",
            type:"text"
        },
        {
            name:"BATCHDESCRIPTION",
            width:"350",
            title:"Description",
            type:"text"
        },
        {
            name:"CREATIONDATE",
            title:"Created",
            type:"datetime",
            canEdit:false
        },
        {
            name:"MODIFICATIONDATE",
            title:"Modified",
            type:"datetime",
            canEdit:false
        },
        {
            showHintInField:"false",
            hint:"If you enter a number here, it will be included with your billing statement",
            name:"PUBLISHERBILLINGSTRING",
            width:"350",
            title:"Billing Reference",
            type:"text"
        },
        {
            name:"GENERATEDCOUNT",
            title:"Count",
            type:"integer"
        },
        {
            showHintInField:"false",
            hint:"When creating a demo, you may only need one code that can be used </br>multiple times",
            name:"REQUESTCOUNT",
            width:"55",
            title:"Number of codes to generate",
            type:"integer"
        },
        {
            name:"REDEMPTIONCOUNT",
            title:"Redemptions",
            type:"integer"
        },
        {
            name:"EXPORTCOUNT",
            title:"Downloads",
            type:"integer"
        },
        {
            name:"CREATED_BY_FULLNAME",
            title:"Created By",
            type:"text"
        },
        {
            name:"HIDDEN",
            title:"Hidden",
            type:"boolean"
        },
        {
            name:"LASTEXPORTDATE",
            title:"Last Download",
            type:"date"
        },
        {
            name:"LASTEXPORTBY",
            title:"Last Downloaded By",
            type:"text"
        },
        {
            name:"FACTORYPKID",
            type:"integer",
            mappedBeanClass:"com.paceap.eden.jpa.main.CodeFactory"
        },
        {
            name:"LASTREDEMPTIONDATE",
            title:"Last Redemption",
            type:"date"
        },
        {
            name:"ICONGRAPHIC",
            width:"40",
            type:"text",
            defaultValue:"batch_40.png",
            height:"40"
        },
        {
            name:"BILLINGREFERENCE",
            title:"Billing Reference",
            type:"text"
        }
    ]
})
