Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 830a7e2e

Přidáno uživatelem Michal Linha před téměř 4 roky(ů)

re #8176 nothing; re #8178 added checks for data types; added table name to the generated table

Zobrazit rozdíly:

src/main/java/vldc/aswi/web/controller/ConfigurationController.java
72 72
    /**
73 73
     * Opens an configuration page after configuration name was clicked
74 74
     * @param id ID of configuration
75
     * @param errorMsg Error message text.
76
     * @param successMsg Success message text.
75 77
     * @return modelAndView of page to be shown
76 78
     */
77 79
    @GetMapping("/configuration")
......
113 115
    /**
114 116
     * Saves or edits configuration and redirects to the page with configuration
115 117
     * @param newConfiguration contained with configuration data
116
     * @param id ID of configuration, if empty new configuration is created
117
     * @param bindingResult binding result
118
     * @return modelAndView with redirection
118
     * @param bindingResult - Error results from assembly validators.
119
     * @param isNotRemoveEmptyString String that stores if switch to not remove empty rows and columns was set.
120
     * @param id ID of the assembly.
121
     * @param generateTable String used to check if generate table button was clicked.
122
     * @param exportPdf String used to check if export to PDF button was clicked.
123
     * @param exportXlsx String used to check if export to XLSX button was clicked.
124
     * @param redirectAttributes Attributes.
125
     * @param saveConfiguration String used to check if save configuration button was clicked.
126
     * @param response HTTP servlet response.
127
     * @param request HTTP servlet request.
128
     * @return ModelAndView for assembly.
119 129
     */
120 130
    @PostMapping("/configuration")
121 131
    public ModelAndView configurationPost(@Valid Configuration newConfiguration,
......
155 165
            }
156 166
            else {
157 167
                List<ContingencyTableRow> rows = this.sqlQueryManager.getContingencyTableRow(newConfiguration.getAssembly(),
158
                        newConfiguration.getParametersInConfiguration(), isNotRemoveEmpty);
159

  
160
                modelMap.addAttribute("configurationID", id);
161
                modelMap.addAttribute("contingencyTableRows", rows);
162
                addConfigurationDataIntoModelAndView(newConfiguration, modelAndView, modelMap);
168
                        newConfiguration.getParametersInConfiguration(), isNotRemoveEmpty, newConfiguration.getTableName());
169

  
170
                if (rows != null) {
171
                    if (rows.isEmpty()) {
172
                        modelMap.addAttribute(assemblyErrorName, "Výsledná tabulka neobsahuje žádné hodnoty (" +
173
                                "SQL dotaz nevrátil žádné řádky)!");
174
                        modelMap.addAttribute(assemblyTitleName, generateTableTitleText + " " + newConfiguration.getName());
175
                    }
176
                    else {
177
                        modelMap.addAttribute("configurationID", id);
178
                        modelMap.addAttribute("contingencyTableRows", rows);
179
                        modelMap.addAttribute("isNotRemoveEmpty", isNotRemoveEmpty);
180
                        addConfigurationDataIntoModelAndView(newConfiguration, modelAndView, modelMap);
181
                    }
182
                }
183
                else {
184
                    modelMap.addAttribute(assemblyErrorName, "Vyskytla se chyba v SQL dotazu! Prosím " +
185
                            "zkontrolujte zadané hodnoty filtrů nebo kontaktujte administrátora!");
186
                    modelMap.addAttribute(assemblyTitleName, generateTableTitleText + " " + newConfiguration.getName());
187
                }
163 188
            }
164 189
        }
165 190
        else if (exportXlsx != null)
......
195 220
    /**
196 221
     * Get method for configuration delete.
197 222
     * @param id - ID of configuration.
223
     * @param redirectAttributes Attributes.
198 224
     * @return ModelAndView for index.
199 225
     */
200 226
    @GetMapping("/configuration_delete")

Také k dispozici: Unified diff