Commit 494949bbd2ad23901474a2fc343ef91b120edbf9
1 parent
2b6b4308
Exists in
master
and in
112 other branches
Remove dataproduct_types and mimetypes json files and remove Type and Format col…
…umns on granules grid.
Showing
6 changed files
with
84 additions
and
79 deletions
Show diff stats
generic_data/EpnTapData/dataproduct_types.json deleted
... | ... | @@ -1,14 +0,0 @@ |
1 | -{ | |
2 | - "im": "Image", | |
3 | - "ma": "Map", | |
4 | - "sp": "Spectrum", | |
5 | - "ds": "Dynamic spectrum", | |
6 | - "sc": "Spectral cube", | |
7 | - "pr": "Profile", | |
8 | - "vo": "Volume", | |
9 | - "mo": "Movie", | |
10 | - "cu": "Cube", | |
11 | - "ts": "Time series", | |
12 | - "ca": "Catalogue", | |
13 | - "ci": "Catalogue item" | |
14 | -} |
generic_data/EpnTapData/mimetypes.json deleted
... | ... | @@ -1,48 +0,0 @@ |
1 | -{ | |
2 | - "application/fits": "fits", | |
3 | - "application/x-pds": "pds", | |
4 | - "image/x-pds": "pds", | |
5 | - "application/gml+xml": "gml", | |
6 | - "application/json": "json", | |
7 | - "application/octet-stream": "bin, idl, envi or matlab", | |
8 | - "application/pdf": "pdf", | |
9 | - "application/postscript": "ps", | |
10 | - "application/vnd.geo+json": "geojson", | |
11 | - "application/vnd.google-earth.kml+xml": "kml", | |
12 | - "application/vnd.google-earth.kmz": "kmz", | |
13 | - "application/vnd.ms-excel": "xls", | |
14 | - "application/x-asdm": "asdm", | |
15 | - "application/x-cdf": "cdf", | |
16 | - "application/x-cdf-istp": "cdf", | |
17 | - "application/x-cdf-pds4": "cdf", | |
18 | - "application/x-cef1": "cef1", | |
19 | - "application/x-cef2": "cef2", | |
20 | - "application/x-directory": "dir", | |
21 | - "application/x-fits-bintable": "bintable", | |
22 | - "application/x-fits-euro3d": "euro3d", | |
23 | - "application/x-fits-mef": "mef", | |
24 | - "application/x-geotiff": "geotiff", | |
25 | - "application/x-hdf": "hdf", | |
26 | - "application/x-netcdf": "nc", | |
27 | - "application/x-netcdf4": "nc", | |
28 | - "application/x-tar": "tar", | |
29 | - "application/x-tar-gzip": "gtar", | |
30 | - "application/x-votable+xml": "votable", | |
31 | - "application/x-votable+xml;content=datalink": "votable", | |
32 | - "application/zip": "zip", | |
33 | - "image/fits": "fits", | |
34 | - "image/gif": "gif", | |
35 | - "image/jpeg": "jpeg", | |
36 | - "image/png": "png", | |
37 | - "image/tiff": "tiff", | |
38 | - "image/x-fits-gzip": "fits", | |
39 | - "image/x-fits-hcompress": "fits", | |
40 | - "text/csv": "csv", | |
41 | - "text/html": "html", | |
42 | - "text/plain": "txt", | |
43 | - "text/tab-separated-values": "tsv", | |
44 | - "text/xml": "xml", | |
45 | - "video/mpeg": "mpeg", | |
46 | - "video/quicktime": "mov", | |
47 | - "video/x-msvideo": "avi" | |
48 | -} |
js/app/controllers/EpnTapModule.js
... | ... | @@ -7,6 +7,70 @@ |
7 | 7 | * @author Nathanael Jourdane |
8 | 8 | */ |
9 | 9 | |
10 | +productTypeDict = { | |
11 | + 'im': 'Image', | |
12 | + 'ma': 'Map', | |
13 | + 'sp': 'Spectrum', | |
14 | + 'ds': 'Dynamic spectrum', | |
15 | + 'sc': 'Spectral cube', | |
16 | + 'pr': 'Profile', | |
17 | + 'vo': 'Volume', | |
18 | + 'mo': 'Movie', | |
19 | + 'cu': 'Cube', | |
20 | + 'ts': 'Time series', | |
21 | + 'ca': 'Catalogue', | |
22 | + 'ci': 'Catalogue item' | |
23 | +} | |
24 | + | |
25 | +mimetypeDict = { | |
26 | + 'application/fits': 'fits', | |
27 | + 'application/x-pds': 'pds', | |
28 | + 'image/x-pds': 'pds', | |
29 | + 'application/gml+xml': 'gml', | |
30 | + 'application/json': 'json', | |
31 | + 'application/octet-stream': 'bin, idl, envi or matlab', | |
32 | + 'application/pdf': 'pdf', | |
33 | + 'application/postscript': 'ps', | |
34 | + 'application/vnd.geo+json': 'geojson', | |
35 | + 'application/vnd.google-earth.kml+xml': 'kml', | |
36 | + 'application/vnd.google-earth.kmz': 'kmz', | |
37 | + 'application/vnd.ms-excel': 'xls', | |
38 | + 'application/x-asdm': 'asdm', | |
39 | + 'application/x-cdf': 'cdf', | |
40 | + 'application/x-cdf-istp': 'cdf', | |
41 | + 'application/x-cdf-pds4': 'cdf', | |
42 | + 'application/x-cef1': 'cef1', | |
43 | + 'application/x-cef2': 'cef2', | |
44 | + 'application/x-directory': 'dir', | |
45 | + 'application/x-fits-bintable': 'bintable', | |
46 | + 'application/x-fits-euro3d': 'euro3d', | |
47 | + 'application/x-fits-mef': 'mef', | |
48 | + 'application/x-geotiff': 'geotiff', | |
49 | + 'application/x-hdf': 'hdf', | |
50 | + 'application/x-netcdf': 'nc', | |
51 | + 'application/x-netcdf4': 'nc', | |
52 | + 'application/x-tar': 'tar', | |
53 | + 'application/x-tar-gzip': 'gtar', | |
54 | + 'application/x-votable+xml': 'votable', | |
55 | + 'application/x-votable+xml;content=datalink': 'votable', | |
56 | + 'application/zip': 'zip', | |
57 | + 'image/fits': 'fits', | |
58 | + 'image/gif': 'gif', | |
59 | + 'image/jpeg': 'jpeg', | |
60 | + 'image/png': 'png', | |
61 | + 'image/tiff': 'tiff', | |
62 | + 'image/x-fits-gzip': 'fits', | |
63 | + 'image/x-fits-hcompress': 'fits', | |
64 | + 'text/csv': 'csv', | |
65 | + 'text/html': 'html', | |
66 | + 'text/plain': 'txt', | |
67 | + 'text/tab-separated-values': 'tsv', | |
68 | + 'text/xml': 'xml', | |
69 | + 'video/mpeg': 'mpeg', | |
70 | + 'video/quicktime': 'mov', | |
71 | + 'video/x-msvideo': 'avi' | |
72 | +} | |
73 | + | |
10 | 74 | // Load text with Ajax synchronously: takes path to file and optional MIME type. |
11 | 75 | function loadTextFileAjaxSync(filePath, mimeType) { |
12 | 76 | var xmlhttp=new XMLHttpRequest(); |
... | ... | @@ -47,8 +111,6 @@ Ext.define('amdaDesktop.EpnTapModule', { |
47 | 111 | |
48 | 112 | this.metadata = JSON.parse(loadTextFileAjaxSync('../../generic_data/EpnTapData/metadata.json', 'application/json')); |
49 | 113 | this.services = JSON.parse(loadTextFileAjaxSync('../../generic_data/EpnTapData/services.json', 'application/json')); |
50 | - this.productTypeDict = JSON.parse(loadTextFileAjaxSync('../../generic_data/EpnTapData/dataproduct_types.json', 'application/json')); | |
51 | - this.mimetypeDict = JSON.parse(loadTextFileAjaxSync('../../generic_data/EpnTapData/mimetypes.json', 'application/json')); | |
52 | 114 | |
53 | 115 | this.select = Array(); |
54 | 116 | this.filter = Array(); |
... | ... | @@ -111,7 +173,7 @@ Ext.define('amdaDesktop.EpnTapModule', { |
111 | 173 | } |
112 | 174 | |
113 | 175 | var target = icons_dic[icon_id]; |
114 | - console.log("target: ", target); | |
176 | + // console.log("target: ", target); | |
115 | 177 | this.initWindow(target); |
116 | 178 | }, |
117 | 179 | |
... | ... | @@ -143,8 +205,8 @@ Ext.define('amdaDesktop.EpnTapModule', { |
143 | 205 | // Update productTypeCB |
144 | 206 | this.productTypeCB.getStore().add({'id': 'all', 'name': 'All data product types'}); |
145 | 207 | for (var productTypeId in this.metadata) { |
146 | - if (productTypeId in this.productTypeDict) { | |
147 | - this.productTypeCB.getStore().add({'id': productTypeId, 'name': this.prettify(this.productTypeDict[productTypeId])}); | |
208 | + if (productTypeId in productTypeDict) { | |
209 | + this.productTypeCB.getStore().add({'id': productTypeId, 'name': this.prettify(productTypeDict[productTypeId])}); | |
148 | 210 | } else { |
149 | 211 | console.log('Unknown data product type "' + productTypeId + '"'); |
150 | 212 | } |
... | ... | @@ -154,7 +216,7 @@ Ext.define('amdaDesktop.EpnTapModule', { |
154 | 216 | if(target) { |
155 | 217 | // --- Select product types --- |
156 | 218 | if (! target[0] in this.productTypeCB.getStore()) { |
157 | - alert("Sorry, product type " + this.productTypeDict[target[0]] + " is not found in available services."); | |
219 | + alert("Sorry, product type " + productTypeDict[target[0]] + " is not found in available services."); | |
158 | 220 | return; |
159 | 221 | } |
160 | 222 | this.productTypeCB.select(target[0]); |
... | ... | @@ -214,7 +276,7 @@ Ext.define('amdaDesktop.EpnTapModule', { |
214 | 276 | this.targetClassCB.disable(); |
215 | 277 | this.targetClassCB.select(this.targetClassCB.getStore().getAt(0)['internalId']); |
216 | 278 | } else { |
217 | - this.targetClassCB.getStore().add({'id': 'all', 'name': this.allPrettify(this.productTypeDict[this.productTypeCB.value])}); | |
279 | + this.targetClassCB.getStore().add({'id': 'all', 'name': this.allPrettify(productTypeDict[this.productTypeCB.value])}); | |
218 | 280 | for (var targetClassId in targetClasses) { |
219 | 281 | this.targetClassCB.getStore().add({'id': targetClassId, 'name': this.prettify(targetClassId)}); |
220 | 282 | } |
... | ... | @@ -272,7 +334,7 @@ Ext.define('amdaDesktop.EpnTapModule', { |
272 | 334 | for debug purposes only. |
273 | 335 | */ |
274 | 336 | onRowsPerPageChanged: function() { |
275 | - console.log("rows per page: " + this.productTypeCB); | |
337 | + // console.log("rows per page: " + this.productTypeCB); | |
276 | 338 | }, |
277 | 339 | |
278 | 340 | /********************* |
... | ... | @@ -349,7 +411,7 @@ Ext.define('amdaDesktop.EpnTapModule', { |
349 | 411 | var offset = (newPageNumber-1) * limit; |
350 | 412 | var selectedServiceURL = this.services[this.selectedServiceId]['accessurl']; |
351 | 413 | |
352 | - console.log(newPageNumber, limit, offset, selectedServiceURL); | |
414 | + // console.log(newPageNumber, limit, offset, selectedServiceURL); | |
353 | 415 | |
354 | 416 | this.wait(); |
355 | 417 | this.currentPageLb.setText('' + newPageNumber); |
... | ... | @@ -397,8 +459,8 @@ Ext.define('amdaDesktop.EpnTapModule', { |
397 | 459 | Trigerred when a row is clicked in `granulesGrid` table (see `EpnTapUI.createGranulesGrid()`). Do nothing yet, used |
398 | 460 | for debug purposes only. |
399 | 461 | */ |
400 | - onGranuleSelected: function(ui) { | |
401 | - console.log('selected granule: ' + granule.targetName); | |
462 | + onGranuleSelected: function(granule) { | |
463 | + // console.log('selected granule: ' + granule['target_name']); | |
402 | 464 | }, |
403 | 465 | |
404 | 466 | /********************** |
... | ... | @@ -535,7 +597,6 @@ Ext.define('amdaDesktop.EpnTapModule', { |
535 | 597 | */ |
536 | 598 | fillGranules: function(granules) { |
537 | 599 | // console.log(granules); |
538 | - // return; | |
539 | 600 | |
540 | 601 | if (granules["error"] != null) { |
541 | 602 | alert(granules["error"]); |
... | ... |
js/app/views/EpnTapUI.js
... | ... | @@ -89,7 +89,7 @@ Ext.create('Ext.data.Store', { |
89 | 89 | |
90 | 90 | /** |
91 | 91 | `granulesStore`: An ExtJS Store containing the list of granules of the selected service (on `servicesGrid`), which match |
92 | -with tge granules filter (the selected data product type, target class and target name). | |
92 | +with the granules filter (the selected data product type, target class and target name). | |
93 | 93 | |
94 | 94 | This list is used to fill the `granulesGrid` table, which is updated by `EpnTapModule` each time a new service is |
95 | 95 | selected. |
... | ... | @@ -231,21 +231,27 @@ Ext.define('amdaUI.EpnTapUI', { |
231 | 231 | */ |
232 | 232 | var createGranulesGrid = function() { |
233 | 233 | var txtRender = function(val) { |
234 | + console.log('txtRender: ' + val); | |
234 | 235 | return '<p style="white-space: normal;">' + val + '</p>'; |
235 | 236 | }; |
236 | 237 | var linkRender = function(val) { |
238 | + console.log('linkRender: ' + val); | |
237 | 239 | return '<a href="' + val + '">data</a>'; |
238 | 240 | }; |
239 | 241 | var imgRender = function(val) { |
242 | + console.log('imgRender: ' + val); | |
240 | 243 | return '<img width="40px height="40px" src="' + val + '">'; |
241 | 244 | }; |
242 | 245 | var dptRender = function(val) { |
246 | + console.log('dptRender: ' + val); | |
243 | 247 | return (val in mod.productTypeDict) ? '<p style="white-space: normal;">' + mod.productTypeDict[val] + '</p>' : '<em>' + val + '</em>'; |
244 | 248 | }; |
245 | 249 | var formatRender = function(val) { |
250 | + console.log('formatRender: ' + val); | |
246 | 251 | return (val in mod.mimetypeDict) ? mod.mimetypeDict[val] : '<em style="white-space: normal;">' + val + '</em>'; |
247 | 252 | }; |
248 | 253 | var sizeRender = function(val) { |
254 | + console.log('sizeRender: ' + val); | |
249 | 255 | var size = parseInt(val); |
250 | 256 | if (isNaN(size)) { |
251 | 257 | return ''; |
... | ... | @@ -269,18 +275,18 @@ Ext.define('amdaUI.EpnTapUI', { |
269 | 275 | // height: 500, |
270 | 276 | columns: [ |
271 | 277 | { text: 'Num', dataIndex: 'num', flex: 1, renderer: txtRender }, |
272 | - { text: 'Type', dataIndex: 'dataproduct_type', flex: 2, renderer: dptRender }, | |
278 | + // { text: 'Type', dataIndex: 'dataproduct_type', flex: 2, renderer: dptRender }, | |
273 | 279 | { text: 'Target', dataIndex: 'target_name', flex: 2, renderer: txtRender }, |
274 | 280 | { text: 'Time min', dataIndex: 'time_min', flex: 2, renderer: txtRender }, |
275 | 281 | { text: 'Time max', dataIndex: 'time_max', flex: 2, renderer: txtRender }, |
276 | - { text: 'Format', dataIndex: 'access_format', flex: 2, renderer: formatRender }, | |
282 | + // { text: 'Format', dataIndex: 'access_format', flex: 2, renderer: formatRender }, | |
277 | 283 | { text: 'uid', dataIndex: 'granule_uid', flex: 2, renderer: txtRender }, |
278 | 284 | { text: 'Size', dataIndex: 'access_estsize', flex: 1, renderer: sizeRender }, |
279 | 285 | { text: 'URL', dataIndex: 'access_url', flex: 1, renderer: linkRender }, |
280 | 286 | { text: 'Thumb.', dataIndex: 'thumbnail_url', flex: 1, renderer: imgRender} |
281 | 287 | ], |
282 | 288 | listeners: { |
283 | - 'cellclick': function(grid, td, cellIndex, record) { mod.onGranuleSelected(record.data['id']); } | |
289 | + 'cellclick': function(grid, td, cellIndex, record) { mod.onGranuleSelected(record.data); } | |
284 | 290 | }, |
285 | 291 | renderTo: Ext.getBody() |
286 | 292 | }); |
... | ... |
php/classes/EpnTapMgr.php