Project

General

Profile

Download (3.15 KB) Statistics
| Branch: | Revision:

git_sitools_idoc / sitools-idoc / hesiod / js / workspace / client-user / js / components / datasetServices / viewCubeService.js @ 779bac69

1
/*******************************************************************************
2
 * Copyright 2010-2013 CNES - CENTRE NATIONAL d'ETUDES SPATIALES
3
 * 
4
 * This file is part of SITools2.
5
 * 
6
 * SITools2 is free software: you can redistribute it and/or modify it under the
7
 * terms of the GNU General Public License as published by the Free Software
8
 * Foundation, either version 3 of the License, or (at your option) any later
9
 * version.
10
 * 
11
 * SITools2 is distributed in the hope that it will be useful, but WITHOUT ANY
12
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14
 * 
15
 * You should have received a copy of the GNU General Public License along with
16
 * SITools2. If not, see <http://www.gnu.org/licenses/>.
17
 ******************************************************************************/
18
/*global Ext, sitools, ID, i18n, document, showResponse, alertFailure, LOCALE, ImageChooser, loadUrl, extColModelToStorage, SitoolsDesk, WARNING_NB_RECORDS_PLOT*/
19

    
20
Ext.namespace('sitools.user.component.dataviews.services');
21

    
22
/**
23
 * service used to show the plot
24
 * 
25
 * @required datasetId
26
 * @required datasetUrl
27
 * @cfg {Ext.data.JsonStore} the store where nodes are saved
28
 * @class sitools.user.component.dataviews.services.addSelectionService
29
 * @extends Ext.Window
30
 */
31
sitools.user.component.dataviews.services.viewCubeService = {};
32

    
33
Ext.reg('sitools.user.component.dataviews.services.viewCubeService', sitools.user.component.dataviews.services.viewCubeService);
34

    
35
sitools.user.component.dataviews.services.viewCubeService.getParameters = function () {
36
        return [];
37
};
38

    
39
sitools.user.component.dataviews.services.viewCubeService.getDefaultParameters = function () {
40
        console.log("Je suis dans le sitools.user.component.dataviews.services.viewCubeService ");
41
        return [{
42
                        name : "featureType",
43
                        value : "URL"
44
                }, {
45
                        name : "columnAlias",
46
                        value : "cube"
47
                }];
48
};
49

    
50
sitools.user.component.dataviews.services.viewCubeService.executeAsService = function (config) {
51

    
52
    var grid = config.dataview;
53
    var datasetId = grid.datasetId;
54
    var datasetUrl = grid.sitoolsAttachementForUsers;
55
    var datasetName = grid.datasetName;
56
    //var sortInfo = grid.getSortInfo();
57
    var colModel = config.columnModel;
58

    
59
    
60
   /* Ext.each(config.parameters, function (param) {
61
        if (param.name === "columnAlias") {
62
                columnAlias = param.value;
63
        }
64
    }, this);
65
    */
66
    var jsObj = sitools.user.component.viewCubeService;
67
    var componentCfg = {
68
        dataUrl : datasetUrl,
69
        datasetName : datasetName,
70
        datasetId : datasetId,
71
        componentType : "viewCube",
72
        preferencesPath : "/" + datasetName,
73
        preferencesFileName : "viewCube",
74
        dataview : config.dataview,
75
        columnAlias : config.columnAlias,
76
        record : config.record,
77
        columnModel : colModel
78
    };
79
    var windowConfig = {
80
        id : "viewCube" + datasetId,
81
        title : "View cube : " + datasetName,
82
        iconCls : "viewCube",
83
        datasetName : datasetName,
84
        type : "viewCube",
85
        saveToolbar : true,
86
    };
87
    SitoolsDesk.addDesktopWindow(windowConfig, componentCfg, jsObj);
88
};