220 {
221 ValidationResult result;
222
223
224 if (mName.empty()) {
225 result.errors.push_back("Chain name is required");
226 }
227
228 if (mFilePath.empty()) {
229 result.warnings.push_back("Chain file path not set");
230 }
231
232
233 if (mItems.empty()) {
234 result.warnings.push_back("Chain has no items");
235 }
236
237 for (size_t i = 0; i < mItems.size(); i++) {
239 std::string prefix = "Item " + std::to_string(i + 1) + ": ";
240
242
243 if (item.
title.empty()) {
244 result.warnings.push_back(prefix + "Page has no title");
245 }
246
248 result.warnings.push_back(prefix + "Page has no content");
249 }
250
251 } else {
252
254 result.errors.push_back(prefix + "Test name is required");
255 }
256
257
258 if (study != nullptr) {
260 if (test == nullptr) {
261 result.errors.push_back(prefix +
"Test not found in study: " + item.
testName);
262 } else {
263
265 result.warnings.push_back(prefix +
"Test is marked as not included: " + item.
testName);
266 }
267
268
271 if (variant == nullptr) {
272 result.errors.push_back(prefix +
"Parameter variant not found: " + item.
paramVariant);
273 }
274 }
275
276
279 bool langFound = false;
280 for (const auto& lang : availableLangs) {
282 langFound = true;
283 break;
284 }
285 }
286 if (!langFound && !availableLangs.empty()) {
287 result.warnings.push_back(prefix +
"Language not found in translations: " + item.
language);
288 }
289 }
290 }
291 }
292 }
293 }
294
295 return result;
296}
std::vector< std::string > GetAvailableLanguages(const std::string &studyPath) const
const ParameterVariant * GetVariant(const std::string &variantName) const