diff --git a/code-gen-library/AirplaneSeats/XPLAT-CONFIG.json b/code-gen-library/AirplaneSeats/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/AirplaneSeats/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/AnalyzeSales/XPLAT-CONFIG.json b/code-gen-library/AnalyzeSales/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/AnalyzeSales/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/AthletesData/XPLAT-CONFIG.json b/code-gen-library/AthletesData/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/AthletesData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/AthletesDataExtended/XPLAT-CONFIG.json b/code-gen-library/AthletesDataExtended/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/AthletesDataExtended/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/CountryStats/XPLAT-CONFIG.json b/code-gen-library/CountryStats/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/CountryStats/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/CountyHierarchicalData/XPLAT-CONFIG.json b/code-gen-library/CountyHierarchicalData/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/CountyHierarchicalData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/EmployeesData/XPLAT-CONFIG.json b/code-gen-library/EmployeesData/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/EmployeesData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/FinancialDataAll/XPLAT-CONFIG.json b/code-gen-library/FinancialDataAll/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/FinancialDataAll/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/FinancialDataCurrencies/XPLAT-CONFIG.json b/code-gen-library/FinancialDataCurrencies/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/FinancialDataCurrencies/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/FinancialDataFuel/XPLAT-CONFIG.json b/code-gen-library/FinancialDataFuel/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/FinancialDataFuel/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/FinancialDataMetals/XPLAT-CONFIG.json b/code-gen-library/FinancialDataMetals/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/FinancialDataMetals/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/HierarchicalCustomers/XPLAT-CONFIG.json b/code-gen-library/HierarchicalCustomers/XPLAT-CONFIG.json index c4834c37..6f7f1c3a 100644 --- a/code-gen-library/HierarchicalCustomers/XPLAT-CONFIG.json +++ b/code-gen-library/HierarchicalCustomers/XPLAT-CONFIG.json @@ -1,7 +1,3 @@ -[{ - "platform": "WebComponents", - "location": "jsonFile" -},{ - "platform": "React", - "location": "jsonFile" -}] \ No newline at end of file +{ + "location": "CDN" +} diff --git a/code-gen-library/HierarchicalCustomersData/XPLAT-CONFIG.json b/code-gen-library/HierarchicalCustomersData/XPLAT-CONFIG.json index c4834c37..6f7f1c3a 100644 --- a/code-gen-library/HierarchicalCustomersData/XPLAT-CONFIG.json +++ b/code-gen-library/HierarchicalCustomersData/XPLAT-CONFIG.json @@ -1,7 +1,3 @@ -[{ - "platform": "WebComponents", - "location": "jsonFile" -},{ - "platform": "React", - "location": "jsonFile" -}] \ No newline at end of file +{ + "location": "CDN" +} diff --git a/code-gen-library/InvoicesData/XPLAT-CONFIG.json b/code-gen-library/InvoicesData/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/InvoicesData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/InvoicesWorldData/XPLAT-CONFIG.json b/code-gen-library/InvoicesWorldData/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/InvoicesWorldData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/PivotData/XPLAT-CONFIG.json b/code-gen-library/PivotData/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/PivotData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/PivotDataFlat/XPLAT-CONFIG.json b/code-gen-library/PivotDataFlat/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/PivotDataFlat/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/PivotSalesData/XPLAT-CONFIG.json b/code-gen-library/PivotSalesData/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/PivotSalesData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/SalesData/XPLAT-CONFIG.json b/code-gen-library/SalesData/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/SalesData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/SingersCustomers/XPLAT-CONFIG.json b/code-gen-library/SingersCustomers/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/SingersCustomers/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/SingersData/XPLAT-CONFIG.json b/code-gen-library/SingersData/XPLAT-CONFIG.json index c4834c37..6f7f1c3a 100644 --- a/code-gen-library/SingersData/XPLAT-CONFIG.json +++ b/code-gen-library/SingersData/XPLAT-CONFIG.json @@ -1,7 +1,3 @@ -[{ - "platform": "WebComponents", - "location": "jsonFile" -},{ - "platform": "React", - "location": "jsonFile" -}] \ No newline at end of file +{ + "location": "CDN" +} diff --git a/code-gen-library/StockAmazon/XPLAT-CONFIG.json b/code-gen-library/StockAmazon/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/StockAmazon/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockGoogle/XPLAT-CONFIG.json b/code-gen-library/StockGoogle/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/StockGoogle/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockMarket100/XPLAT-CONFIG.json b/code-gen-library/StockMarket100/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/StockMarket100/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockMarket1000/XPLAT-CONFIG.json b/code-gen-library/StockMarket1000/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/StockMarket1000/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockMarket2000/XPLAT-CONFIG.json b/code-gen-library/StockMarket2000/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/StockMarket2000/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockMarket500/XPLAT-CONFIG.json b/code-gen-library/StockMarket500/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/StockMarket500/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockMicrosoft/XPLAT-CONFIG.json b/code-gen-library/StockMicrosoft/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/StockMicrosoft/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockSP500Cap/XPLAT-CONFIG.json b/code-gen-library/StockSP500Cap/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/StockSP500Cap/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockTesla/XPLAT-CONFIG.json b/code-gen-library/StockTesla/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/StockTesla/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldAustralianData/XPLAT-CONFIG.json b/code-gen-library/WorldAustralianData/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/WorldAustralianData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCapitals/XPLAT-CONFIG.json b/code-gen-library/WorldCapitals/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/WorldCapitals/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCities/XPLAT-CONFIG.json b/code-gen-library/WorldCities/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/WorldCities/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCitiesAbove100K/XPLAT-CONFIG.json b/code-gen-library/WorldCitiesAbove100K/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/WorldCitiesAbove100K/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCitiesAbove15K/XPLAT-CONFIG.json b/code-gen-library/WorldCitiesAbove15K/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/WorldCitiesAbove15K/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCitiesAbove1M/XPLAT-CONFIG.json b/code-gen-library/WorldCitiesAbove1M/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/WorldCitiesAbove1M/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCitiesAbove500K/XPLAT-CONFIG.json b/code-gen-library/WorldCitiesAbove500K/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/WorldCitiesAbove500K/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCountries/XPLAT-CONFIG.json b/code-gen-library/WorldCountries/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/WorldCountries/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldStats/XPLAT-CONFIG.json b/code-gen-library/WorldStats/XPLAT-CONFIG.json new file mode 100644 index 00000000..6f7f1c3a --- /dev/null +++ b/code-gen-library/WorldStats/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-tools/gulpfile.js b/code-gen-tools/gulpfile.js index 5b98f8e2..7b158adf 100644 --- a/code-gen-tools/gulpfile.js +++ b/code-gen-tools/gulpfile.js @@ -48,11 +48,27 @@ function saveJSON(filePath, dataItems, mode) { } let jsonStr = "[\r\n" + lines.join('\r\n') + "\r\n]"; - jsonStr = utils.strReplace(jsonStr, ":", ": ") + // jsonStr = utils.strReplace(jsonStr, ":", ": ") + // jsonStr = utils.strReplace(jsonStr, ": ", ":") + // jsonStr = utils.strReplace(jsonStr, '": ', '": ') + // jsonStr = utils.strReplace(jsonStr, '": ', '": ') + jsonStr = utils.strReplace(jsonStr, '":0', '": 0') + jsonStr = utils.strReplace(jsonStr, '":1', '": 1') + jsonStr = utils.strReplace(jsonStr, '":2', '": 2') + jsonStr = utils.strReplace(jsonStr, '":3', '": 3') + jsonStr = utils.strReplace(jsonStr, '":4', '": 4') + jsonStr = utils.strReplace(jsonStr, '":5', '": 5') + jsonStr = utils.strReplace(jsonStr, '":6', '": 6') + jsonStr = utils.strReplace(jsonStr, '":7', '": 7') + jsonStr = utils.strReplace(jsonStr, '":8', '": 8') + jsonStr = utils.strReplace(jsonStr, '":9', '": 9') + jsonStr = utils.strReplace(jsonStr, '":"', '": "') + jsonStr = utils.strReplace(jsonStr, '00: 00', '00:00') + // jsonStr = utils.strReplace(jsonStr, ' -1', '-1') jsonStr = utils.strReplace(jsonStr, ',"', ', "') jsonStr = utils.strReplace(jsonStr, '{', '{ ') jsonStr = utils.strReplace(jsonStr, '}', ' }') - + saveFile(filePath, jsonStr); } } @@ -110,12 +126,15 @@ exports.cleanJSON = function cleanJSON(input, cb) { function sortJSON(cb) { // let filePath = CodeGenLib + "/WorldCitiesAbove500K/XPLAT.json"; - let filePath = CodeGenLib + "/WorldCountries/XPLAT.json"; + let filePath = CodeGenLib + "/AthletesData/XPLAT.json"; + // let filePath = CodeGenLib + "/AthletesDataExtended/XPLAT.json"; + // let filePath = CodeGenLib + "/WorldCountries/XPLAT.json"; let file = fs.readFileSync(filePath, "utf8"); let dataItems = JSON.parse(file); // dataItems = dataItems.sort((a, b) => a.Pop < b.Pop ? 1 : -1); - dataItems = dataItems.sort((a, b) => a.Population < b.Population ? 1 : -1); + // dataItems = dataItems.sort((a, b) => a.Population < b.Population ? 1 : -1); + dataItems = dataItems.sort((a, b) => a.Id > b.Id ? 1 : -1); for (let i = 0; i < dataItems.length; i++) { // dataItems[i].ID = 10000 + i; @@ -165,17 +184,89 @@ exports.filterJSON = function filterJSON(cb) { cb(); } +exports.findDataFiles = function findDataFiles(cb) +{ + var largeDataSources = [ 'SingersData', + "AirplaneSeats", + "AnalyzeSales", + "AthletesData", + "AthletesDataExtended", + "CountryStats", + "CountyHierarchicalData", + "EmployeesData", + "FinancialDataAll", + "FinancialDataCurrencies", + "FinancialDataFuel", + "FinancialDataMetals", + "HierarchicalCustomers", + "HierarchicalCustomersData", + "InvoicesData", + "InvoicesWorldData", + "PivotData", + "PivotDataFlat", + "PivotSalesData", + "SalesData", + "SingersCustomers", + "StockAmazon", + "StockGoogle", + "StockMarket100", + "StockMarket1000", + "StockMarket2000", + "StockMarket500", + "StockSP500Cap", + "StockMicrosoft", + "StockTesla", + "WorldAustralianData", + "WorldCapitals", + "WorldCities", + "WorldCitiesAbove100K", + "WorldCitiesAbove15K", + "WorldCitiesAbove1M", + "WorldCitiesAbove500K", + "WorldCountries", + "WorldStats"]; + gulp.src([ '../samples/**/*.json']) + .pipe(es.map(function(file, fileCallback) { + let content = file.contents.toString(); + if (content.indexOf("skipAlterDataCasing") <= 0) { + + for (let i = 0; i < largeDataSources.length; i++) { + const ds = largeDataSources[i]; + if (content.indexOf(ds) >= 0) { + console.log(file.dirname + '/' + file.basename + " \t" + ds); + break; + } + } + + // let lines = content.split('\n'); + // var dataSource = ""; + // for (let i = 0; i < lines.length; i++) { + // const item = lines[i]; + // if (item.indexOf("dataSource") >= 0) { + // dataSource = item; + // } + // } + // console.log(file.dirname + '/' + file.basename + " \t" + dataSource); + } + fileCallback(null, file); + })) + .on("end", function() { + cb(); + }); +} + exports.copyCDN = function copyCDN(cb) { var cdnTable = []; - var cdnWebsite = 'https://static.infragistics.com/xplatform/library/'; - var cdnServer = '//s0706dl2.igweb.local/download.infragistics.com/xplatform/library'; + var cdnWebsite = 'https://static.infragistics.com/xplatform/cdn/'; + var cdnServer = ' \\\\s0706dl2.igweb.local\\download.infragistics.com\\xplatform\\cdn'; var cdnOutput = './CDN'; - // del(cdnOutput); console.log('--------------------------------------------------------------------'); console.log('copying large data files from code-gen-library to: ' + cdnOutput); console.log('--------------------------------------------------------------------'); + // del(cdnOutput); + gulp.src([ // process all files and determine large files based on number of data items and data columns CodeGenLib + '/**/XPLAT.json', @@ -230,36 +321,53 @@ exports.copyCDN = function copyCDN(cb) let dirname = file.dirname.split('code-gen-library\\')[1]; // copy only files that have many items and/or many data columns - if (items.length >= 100 || (items.length * columns.length >= 500)) { + if (items.length >= 100 || (items.length * columns.length >= 500) || dirname === "SingersData") { console.log(CodeGenLib + '/' + dirname + '/XPLAT.json copied with ' + items.length + ' items'); // console.log('CodeGenLib + "/' + dirname + '/XPLAT.json",'); var itemsCount = items.length.toString(); var columnsCount = columns.length.toString(); var row = "
This CDN folder contains data files used by XPLAT samples.
\r\n\r\n' + - 'Use copyCDN script to prepare data files in CodeGen library for manual upload to the CDN. This way, files on CDN stay in-sync with files in CodeGen library.
\r\n\r\n' + + var angular = 'https://github.com/IgniteUI/igniteui-angular-examples/tree/vnext'; + var blazor = 'https://github.com/IgniteUI/igniteui-blazor-examples/tree/vnext'; + var react = 'https://github.com/IgniteUI/igniteui-react-examples/tree/vnext'; + var wc = 'https://github.com/IgniteUI/igniteui-wc-examples/tree/vnext'; + var readme = 'This CDN folder contains data files used by ' + + 'xplat, ' + + 'angular, ' + + 'blazor, ' + + 'react, and ' + + 'web-component samples' + + '
\r\n\r\n' + + 'Use the copyCDN gulp script to collect data files from CodeGen library before manually uploading them to the CDN network location. This way, files on CDN stay in-sync with files in CodeGen library.
\r\n\r\n' + 'The CodeGen library is located on GitHub and CDN has a copy of these files:
\r\n\r\n' + 'Data Items | Data Columns | Data Link |
---|---|---|
Data Items | Data Columns | Data Link |