-
Notifications
You must be signed in to change notification settings - Fork 25
Настройки чтения MDC #531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Настройки чтения MDC #531
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6362d56
создан справочник с настройками чтения MDC. Использование skipSupport…
theshadowco 01c2545
Выполнена обработка остальных опций чтения
theshadowco 5ff6859
sq fixes
theshadowco e49e50d
fix opt
theshadowco 9436c77
fix opt
theshadowco 1ef9fc8
fix opt
theshadowco ce1f769
fix opt
theshadowco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
src/main/java/com/github/_1c_syntax/bsl/mdclasses/MDCReadSettings.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /* | ||
| * This file is a part of MDClasses. | ||
| * | ||
| * Copyright (c) 2019 - 2025 | ||
| * Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors | ||
| * | ||
| * SPDX-License-Identifier: LGPL-3.0-or-later | ||
| * | ||
| * MDClasses is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU Lesser General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 3.0 of the License, or (at your option) any later version. | ||
| * | ||
| * MDClasses is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with MDClasses. | ||
| */ | ||
| package com.github._1c_syntax.bsl.mdclasses; | ||
|
|
||
| import lombok.Builder; | ||
| import lombok.Value; | ||
|
|
||
| /** | ||
| * Настройки чтения MDC | ||
| */ | ||
| @Value | ||
| @Builder | ||
| public class MDCReadSettings { | ||
| /** | ||
| * Настройки по умолчанию | ||
| */ | ||
| public static final MDCReadSettings DEFAULT = MDCReadSettings.builder().build(); | ||
|
|
||
| /** | ||
| * Шаблон с отключением только чтения поддержки | ||
| */ | ||
| public static final MDCReadSettings SKIP_SUPPORT = MDCReadSettings.builder().skipSupport(true).build(); | ||
|
|
||
| /** | ||
| * Пропускать чтение настроек поставки конфигурации | ||
| */ | ||
| boolean skipSupport; | ||
|
|
||
| /** | ||
| * Пропускать чтение содержимого ролей | ||
| */ | ||
| boolean skipRoleData; | ||
|
|
||
| /** | ||
| * Пропускать чтение содержимого xdto пакетов | ||
| */ | ||
| boolean skipXdtoPackage; | ||
|
|
||
| /** | ||
| * Пропускать чтение элементов форм | ||
| */ | ||
| boolean skipFormElementItems; | ||
|
|
||
| /** | ||
| * Пропускать чтение элементов макетов системы компоновки | ||
| */ | ||
| boolean skipDataCompositionSchema; | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,28 @@ | ||
| /* | ||
| * This file is a part of MDClasses. | ||
| * | ||
| * Copyright (c) 2019 - 2025 | ||
| * Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors | ||
| * | ||
| * SPDX-License-Identifier: LGPL-3.0-or-later | ||
| * | ||
| * MDClasses is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU Lesser General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 3.0 of the License, or (at your option) any later version. | ||
| * | ||
| * MDClasses is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with MDClasses. | ||
| */ | ||
| package com.github._1c_syntax.bsl.mdo.storage; | ||
| /* | ||
| * This file is a part of MDClasses. | ||
| * | ||
| * Copyright (c) 2019 - 2025 | ||
| * Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors | ||
| * | ||
| * SPDX-License-Identifier: LGPL-3.0-or-later | ||
| * | ||
| * MDClasses is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU Lesser General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 3.0 of the License, or (at your option) any later version. | ||
| * | ||
| * MDClasses is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with MDClasses. | ||
| */ | ||
| package com.github._1c_syntax.bsl.mdo.storage; | ||
|
|
||
| import com.github._1c_syntax.bsl.mdo.support.DataSetType; | ||
| import com.github._1c_syntax.utils.Lazy; | ||
| import lombok.Builder; | ||
| import lombok.Builder.Default; | ||
| import lombok.EqualsAndHashCode; | ||
|
|
@@ -49,7 +50,7 @@ public class DataCompositionSchema implements TemplateData { | |
| /** | ||
| * Плоский список наборов данных | ||
| */ | ||
| List<DataSet> plainDataSets; | ||
| Lazy<List<DataSet>> plainDataSets = new Lazy<>(this::computePlainDataSets); | ||
|
|
||
| /** | ||
| * Путь к файлу с данными макета | ||
|
|
@@ -59,8 +60,6 @@ public class DataCompositionSchema implements TemplateData { | |
|
|
||
| public DataCompositionSchema(@NonNull List<DataSet> dataSetsTree, @NonNull Path path) { | ||
| dataSets = dataSetsTree; | ||
| plainDataSets = new ArrayList<>(); | ||
| fillPlaintDataSetByList(dataSetsTree); | ||
| dataPath = path; | ||
| } | ||
|
|
||
|
|
@@ -69,10 +68,21 @@ public boolean isEmpty() { | |
| return false; | ||
| } | ||
|
|
||
| private void fillPlaintDataSetByList(List<DataSet> items) { | ||
| public List<DataSet> getPlainDataSets() { | ||
| return plainDataSets.getOrCompute(); | ||
| } | ||
|
|
||
| private List<DataSet> computePlainDataSets() { | ||
| List<DataSet> result = new ArrayList<>(); | ||
| fillPlaintDataSetByList(result, dataSets); | ||
|
|
||
| return result; | ||
| } | ||
|
|
||
| private void fillPlaintDataSetByList(List<DataSet> result, List<DataSet> items) { | ||
| items.forEach((DataSet dataSet) -> { | ||
| plainDataSets.add(dataSet); | ||
| fillPlaintDataSetByList(dataSet.getItems()); | ||
| result.add(dataSet); | ||
| fillPlaintDataSetByList(result, dataSet.getItems()); | ||
| }); | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.