mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-03 02:00:22 +03:00
fix(meta-compile,meta-decompile): полиморфный DataPathField и экранирование кавычек в тексте
Первый полный прогон по всем поддерживаемым типам трёх конфигураций (41366 объектов) вскрыл два дефекта, живущих только в корпусе 2.17. DataPathField в блоке характеристик полиморфно: обычно -1 («не задано»), но в 8 случаях содержит путь к полю. Обе стороны жёстко приводили значение к [int], из-за чего декомпиляция всего объекта падала — 8 документов БП не разбирались вовсе. Теперь число остаётся числом, а путь проходит через Expand-CharField/Shorten-CharField, как соседние путевые поля. Текст элемента экранировался атрибутной функцией: кавычка превращалась в ", тогда как платформа держит её в тексте как есть (наименование «Транспортные средства, зарегистрированные в системе "Платон"» в ERP). В компиляторе для этого давно есть Esc-XmlText/esc_xml_text — переведены все 128 мест эмиссии текста в обоих портах. Замена строго ослабляющая: атрибуты не затронуты, экранирование & < > сохранено. Проверка: три документа БП с путевым DataPathField 3/3, сюита meta-compile 76/76 на обоих портах. Полный прогон корпуса идёт частями. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
b174ca659d
commit
6963df6b99
@@ -1,4 +1,4 @@
|
||||
# meta-compile v1.73 — Compile 1C metadata object from JSON
|
||||
# meta-compile v1.74 — Compile 1C metadata object from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
@@ -375,7 +375,7 @@ function Normalize-FormRef {
|
||||
# Ссылка на форму по умолчанию: непустая → <Tag>значение</Tag>, иначе <Tag/>.
|
||||
function Emit-FormRef {
|
||||
param([string]$i, [string]$tag, $val)
|
||||
if ($val) { X "$i<$tag>$(Esc-Xml (Normalize-FormRef "$val"))</$tag>" } else { X "$i<$tag/>" }
|
||||
if ($val) { X "$i<$tag>$(Esc-XmlText (Normalize-FormRef "$val"))</$tag>" } else { X "$i<$tag/>" }
|
||||
}
|
||||
|
||||
# Ссылка verbatim (без Normalize-FormRef): для форм/схем/хранилищ Report/DataProcessor, где имя формы может быть
|
||||
@@ -383,7 +383,7 @@ function Emit-FormRef {
|
||||
# вида (SettingsStorage.X / Report.X.Template.Y). Декомпилятор пишет полный путь → passthrough.
|
||||
function Emit-VerbatimRef {
|
||||
param([string]$i, [string]$tag, $val)
|
||||
if ($val) { X "$i<$tag>$(Esc-Xml "$val")</$tag>" } else { X "$i<$tag/>" }
|
||||
if ($val) { X "$i<$tag>$(Esc-XmlText "$val")</$tag>" } else { X "$i<$tag/>" }
|
||||
}
|
||||
|
||||
if (-not $def.type) {
|
||||
@@ -1318,7 +1318,7 @@ function Emit-StandardAttribute {
|
||||
$lbtDp = if ($lbt.dataPath) { "$($lbt.dataPath)" } else { "$lbt" }
|
||||
$lbtLi = if ($null -ne $lbt.linkItem) { $lbt.linkItem } else { 0 }
|
||||
X "$indent`t<xr:LinkByType>"
|
||||
X "$indent`t`t<xr:DataPath>$(Esc-Xml $lbtDp)</xr:DataPath>"
|
||||
X "$indent`t`t<xr:DataPath>$(Esc-XmlText $lbtDp)</xr:DataPath>"
|
||||
X "$indent`t`t<xr:LinkItem>$lbtLi</xr:LinkItem>"
|
||||
X "$indent`t</xr:LinkByType>"
|
||||
} else {
|
||||
@@ -1338,7 +1338,7 @@ function Emit-StandardAttribute {
|
||||
Emit-MLText "$indent`t" "xr:ToolTip" $tt
|
||||
X "$indent`t<xr:ExtendedEdit>false</xr:ExtendedEdit>"
|
||||
Emit-MLText "$indent`t" "xr:Format" $fmt
|
||||
if ($cf) { X "$indent`t<xr:ChoiceForm>$(Esc-Xml "$cf")</xr:ChoiceForm>" } else { X "$indent`t<xr:ChoiceForm/>" }
|
||||
if ($cf) { X "$indent`t<xr:ChoiceForm>$(Esc-XmlText "$cf")</xr:ChoiceForm>" } else { X "$indent`t<xr:ChoiceForm/>" }
|
||||
X "$indent`t<xr:QuickChoice>Auto</xr:QuickChoice>"
|
||||
X "$indent`t<xr:ChoiceHistoryOnInput>$chi</xr:ChoiceHistoryOnInput>"
|
||||
Emit-MLText "$indent`t" "xr:EditFormat" $efmt
|
||||
@@ -1358,7 +1358,7 @@ function Emit-StandardAttribute {
|
||||
else {
|
||||
$fvN = Normalize-ChoiceValue $fvRaw
|
||||
if ([string]::IsNullOrEmpty($fvN.Text)) { X "$indent`t<xr:FillValue xsi:type=`"$($fvN.XsiType)`"/>" }
|
||||
else { X "$indent`t<xr:FillValue xsi:type=`"$($fvN.XsiType)`">$(Esc-Xml $fvN.Text)</xr:FillValue>" }
|
||||
else { X "$indent`t<xr:FillValue xsi:type=`"$($fvN.XsiType)`">$(Esc-XmlText $fvN.Text)</xr:FillValue>" }
|
||||
}
|
||||
if ($msk) { X "$indent`t<xr:Mask>$(Esc-XmlText "$msk")</xr:Mask>" } else { X "$indent`t<xr:Mask/>" }
|
||||
Emit-ChoiceParameters "$indent`t" (OvOr 'ChoiceParameters' $null) 'xr:ChoiceParameters'
|
||||
@@ -1503,7 +1503,7 @@ function Emit-LinkByType {
|
||||
if (-not $dp) { X "$indent<LinkByType/>"; return }
|
||||
$dp = Expand-DataPath $dp
|
||||
X "$indent<LinkByType>"
|
||||
X "$indent`t<xr:DataPath>$(Esc-Xml "$dp")</xr:DataPath>"
|
||||
X "$indent`t<xr:DataPath>$(Esc-XmlText "$dp")</xr:DataPath>"
|
||||
X "$indent`t<xr:LinkItem>$li</xr:LinkItem>"
|
||||
X "$indent</LinkByType>"
|
||||
}
|
||||
@@ -1517,7 +1517,7 @@ function Emit-FieldBlock {
|
||||
$arr = @($fields | Where-Object { "$_" -ne '' })
|
||||
if ($arr.Count -eq 0) { X "$indent<$tag/>"; return }
|
||||
X "$indent<$tag>"
|
||||
foreach ($f in $arr) { X "$indent`t<xr:Field>$(Esc-Xml "$f")</xr:Field>" }
|
||||
foreach ($f in $arr) { X "$indent`t<xr:Field>$(Esc-XmlText "$f")</xr:Field>" }
|
||||
X "$indent</$tag>"
|
||||
}
|
||||
|
||||
@@ -1527,7 +1527,7 @@ function Emit-BasedOn {
|
||||
$arr = @($items | Where-Object { $_ })
|
||||
if ($arr.Count -eq 0) { X "$indent<BasedOn/>"; return }
|
||||
X "$indent<BasedOn>"
|
||||
foreach ($it in $arr) { X "$indent`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-Xml (Normalize-MDObjectRef "$it"))</xr:Item>" }
|
||||
foreach ($it in $arr) { X "$indent`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-XmlText (Normalize-MDObjectRef "$it"))</xr:Item>" }
|
||||
X "$indent</BasedOn>"
|
||||
}
|
||||
|
||||
@@ -1658,13 +1658,13 @@ function Emit-ChoiceParameters {
|
||||
if (Is-EmptyRef $v) { X "$indent`t`t`t<v8:Value xsi:type=`"xr:DesignTimeRef`"/>"; continue }
|
||||
$norm = Normalize-ChoiceValueT $v $ptype
|
||||
if ([string]::IsNullOrEmpty($norm.Text)) { X "$indent`t`t`t<v8:Value xsi:type=`"$($norm.XsiType)`"/>" }
|
||||
else { X "$indent`t`t`t<v8:Value xsi:type=`"$($norm.XsiType)`">$(Esc-Xml $norm.Text)</v8:Value>" }
|
||||
else { X "$indent`t`t`t<v8:Value xsi:type=`"$($norm.XsiType)`">$(Esc-XmlText $norm.Text)</v8:Value>" }
|
||||
}
|
||||
X "$indent`t`t</app:value>"
|
||||
} else {
|
||||
$norm = Normalize-ChoiceValueT $val $ptype
|
||||
if ([string]::IsNullOrEmpty($norm.Text)) { X "$indent`t`t<app:value xsi:type=`"$($norm.XsiType)`"/>" }
|
||||
else { X "$indent`t`t<app:value xsi:type=`"$($norm.XsiType)`">$(Esc-Xml $norm.Text)</app:value>" }
|
||||
else { X "$indent`t`t<app:value xsi:type=`"$($norm.XsiType)`">$(Esc-XmlText $norm.Text)</app:value>" }
|
||||
}
|
||||
X "$indent`t</app:item>"
|
||||
}
|
||||
@@ -1690,8 +1690,8 @@ function Emit-ChoiceParameterLinks {
|
||||
}
|
||||
}
|
||||
X "$indent`t<xr:Link>"
|
||||
X "$indent`t`t<xr:Name>$(Esc-Xml "$name")</xr:Name>"
|
||||
X "$indent`t`t<xr:DataPath xsi:type=`"xs:string`">$(Esc-Xml "$dp")</xr:DataPath>"
|
||||
X "$indent`t`t<xr:Name>$(Esc-XmlText "$name")</xr:Name>"
|
||||
X "$indent`t`t<xr:DataPath xsi:type=`"xs:string`">$(Esc-XmlText "$dp")</xr:DataPath>"
|
||||
X "$indent`t`t<xr:ValueChange>$vc</xr:ValueChange>"
|
||||
X "$indent`t</xr:Link>"
|
||||
}
|
||||
@@ -1747,8 +1747,12 @@ function Expand-CharField {
|
||||
return $s
|
||||
}
|
||||
|
||||
# Числовое поле-флаг Characteristics (DataPathField/MultipleValues*) — дефолт -1.
|
||||
function Get-CharIntField { param($obj, [string[]]$names) $v = Get-ChElProp $obj $names; if ($null -eq $v -or "$v" -eq '') { return -1 } return [int]$v }
|
||||
# Поле-флаг Characteristics (DataPathField/MultipleValues*) — дефолт -1. ПОЛИМОРФНО: обычно число,
|
||||
# но DataPathField в некоторых конфигурациях содержит ПУТЬ к полю (8 случаев на корпус) — тогда
|
||||
# пропускаем строку как есть, приведение к [int] на ней падало.
|
||||
function Get-CharIntField { param($obj, [string[]]$names) $v = Get-ChElProp $obj $names; if ($null -eq $v -or "$v" -eq '') { return -1 }
|
||||
if ("$v" -match '^-?\d+$') { return [int]$v }
|
||||
return "$v" }
|
||||
|
||||
function Emit-Characteristics {
|
||||
param([string]$indent, $chars)
|
||||
@@ -1771,23 +1775,23 @@ function Emit-Characteristics {
|
||||
$mvo = Get-CharIntField $values @('multipleValuesOrderField')
|
||||
X "$indent`t<xr:Characteristic>"
|
||||
X "$indent`t`t<xr:CharacteristicTypes from=`"$(Esc-Xml $tFrom)`">"
|
||||
X "$indent`t`t`t<xr:KeyField>$(Esc-Xml $key)</xr:KeyField>"
|
||||
X "$indent`t`t`t<xr:TypesFilterField>$(Esc-Xml $tff)</xr:TypesFilterField>"
|
||||
X "$indent`t`t`t<xr:KeyField>$(Esc-XmlText $key)</xr:KeyField>"
|
||||
X "$indent`t`t`t<xr:TypesFilterField>$(Esc-XmlText $tff)</xr:TypesFilterField>"
|
||||
# filterValue: $null→nil; голое→xs:string, полный путь→DTR, bool→xs:boolean.
|
||||
$tfvRaw = Get-ChElProp $types @('filterValue','typesFilterValue')
|
||||
if ($null -eq $tfvRaw) { X "$indent`t`t`t<xr:TypesFilterValue xsi:nil=`"true`"/>" }
|
||||
else {
|
||||
$tfvN = Normalize-ChoiceValue $tfvRaw
|
||||
if ([string]::IsNullOrEmpty($tfvN.Text)) { X "$indent`t`t`t<xr:TypesFilterValue xsi:type=`"$($tfvN.XsiType)`"/>" }
|
||||
else { X "$indent`t`t`t<xr:TypesFilterValue xsi:type=`"$($tfvN.XsiType)`">$(Esc-Xml $tfvN.Text)</xr:TypesFilterValue>" }
|
||||
else { X "$indent`t`t`t<xr:TypesFilterValue xsi:type=`"$($tfvN.XsiType)`">$(Esc-XmlText $tfvN.Text)</xr:TypesFilterValue>" }
|
||||
}
|
||||
X "$indent`t`t`t<xr:DataPathField>$dpf</xr:DataPathField>"
|
||||
X "$indent`t`t`t<xr:DataPathField>$(Esc-XmlText (Expand-CharField "$dpf" $tFrom))</xr:DataPathField>"
|
||||
X "$indent`t`t`t<xr:MultipleValuesUseField>$mvu</xr:MultipleValuesUseField>"
|
||||
X "$indent`t`t</xr:CharacteristicTypes>"
|
||||
X "$indent`t`t<xr:CharacteristicValues from=`"$(Esc-Xml $vFrom)`">"
|
||||
X "$indent`t`t`t<xr:ObjectField>$(Esc-Xml $obj)</xr:ObjectField>"
|
||||
X "$indent`t`t`t<xr:TypeField>$(Esc-Xml $typ)</xr:TypeField>"
|
||||
X "$indent`t`t`t<xr:ValueField>$(Esc-Xml $val)</xr:ValueField>"
|
||||
X "$indent`t`t`t<xr:ObjectField>$(Esc-XmlText $obj)</xr:ObjectField>"
|
||||
X "$indent`t`t`t<xr:TypeField>$(Esc-XmlText $typ)</xr:TypeField>"
|
||||
X "$indent`t`t`t<xr:ValueField>$(Esc-XmlText $val)</xr:ValueField>"
|
||||
X "$indent`t`t`t<xr:MultipleValuesKeyField>$mvk</xr:MultipleValuesKeyField>"
|
||||
X "$indent`t`t`t<xr:MultipleValuesOrderField>$mvo</xr:MultipleValuesOrderField>"
|
||||
X "$indent`t`t</xr:CharacteristicValues>"
|
||||
@@ -1802,7 +1806,7 @@ function Emit-MinMaxValue {
|
||||
param([string]$indent, [string]$tag, $val)
|
||||
if ($null -eq $val) { X "$indent<$tag xsi:nil=`"true`"/>"; return }
|
||||
$t = if ($val -is [string]) { 'xs:string' } else { 'xs:decimal' }
|
||||
X "$indent<$tag xsi:type=`"$t`">$(Esc-Xml "$val")</$tag>"
|
||||
X "$indent<$tag xsi:type=`"$t`">$(Esc-XmlText "$val")</$tag>"
|
||||
}
|
||||
|
||||
function Emit-Attribute {
|
||||
@@ -1827,7 +1831,7 @@ function Emit-Attribute {
|
||||
$uuid = New-Guid-String
|
||||
X "$indent<$elemTag uuid=`"$uuid`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $parsed.name)</Name>"
|
||||
X "$indent`t`t<Name>$(Esc-XmlText $parsed.name)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $parsed.synonym
|
||||
if ($parsed.comment) { X "$indent`t`t<Comment>$(Esc-XmlText $parsed.comment)</Comment>" } else { X "$indent`t`t<Comment/>" }
|
||||
|
||||
@@ -1891,7 +1895,7 @@ function Emit-Attribute {
|
||||
X "$indent`t`t<QuickChoice>$qc</QuickChoice>"
|
||||
$coi = if ($parsed.createOnInput) { $parsed.createOnInput } else { "Auto" }
|
||||
X "$indent`t`t<CreateOnInput>$coi</CreateOnInput>"
|
||||
if ($parsed.choiceForm) { X "$indent`t`t<ChoiceForm>$(Esc-Xml "$($parsed.choiceForm)")</ChoiceForm>" } else { X "$indent`t`t<ChoiceForm/>" }
|
||||
if ($parsed.choiceForm) { X "$indent`t`t<ChoiceForm>$(Esc-XmlText "$($parsed.choiceForm)")</ChoiceForm>" } else { X "$indent`t`t<ChoiceForm/>" }
|
||||
Emit-LinkByType "$indent`t`t" $parsed.linkByType
|
||||
$chi = if ($parsed.choiceHistoryOnInput) { $parsed.choiceHistoryOnInput } else { "Auto" }
|
||||
X "$indent`t`t<ChoiceHistoryOnInput>$chi</ChoiceHistoryOnInput>"
|
||||
@@ -1921,7 +1925,7 @@ function Emit-Attribute {
|
||||
}
|
||||
# Регистр расчёта: ScheduleLink у измерений и реквизитов (НЕ ресурсов), перед Indexing. Дефолт пустой.
|
||||
if ($context -eq "register-calc" -and $elemTag -in @("Dimension", "Attribute")) {
|
||||
if ($parsed.scheduleLink) { X "$indent`t`t<ScheduleLink>$(Esc-Xml "$($parsed.scheduleLink)")</ScheduleLink>" }
|
||||
if ($parsed.scheduleLink) { X "$indent`t`t<ScheduleLink>$(Esc-XmlText "$($parsed.scheduleLink)")</ScheduleLink>" }
|
||||
else { X "$indent`t`t<ScheduleLink/>" }
|
||||
}
|
||||
|
||||
@@ -1930,12 +1934,12 @@ function Emit-Attribute {
|
||||
if ($context -eq "register-account" -and $elemTag -in @("Dimension", "Resource")) {
|
||||
$balance = if ($parsed.balance -eq $true -or $parsed.flags -contains "balance") { "true" } else { "false" }
|
||||
X "$indent`t`t<Balance>$balance</Balance>"
|
||||
if ($parsed.accountingFlag) { X "$indent`t`t<AccountingFlag>$(Esc-Xml "$($parsed.accountingFlag)")</AccountingFlag>" } else { X "$indent`t`t<AccountingFlag/>" }
|
||||
if ($parsed.accountingFlag) { X "$indent`t`t<AccountingFlag>$(Esc-XmlText "$($parsed.accountingFlag)")</AccountingFlag>" } else { X "$indent`t`t<AccountingFlag/>" }
|
||||
if ($elemTag -eq "Dimension") {
|
||||
$denyIncomplete = if ($parsed.denyIncompleteValues -eq $true -or $parsed.flags -contains "denyincomplete") { "true" } else { "false" }
|
||||
X "$indent`t`t<DenyIncompleteValues>$denyIncomplete</DenyIncompleteValues>"
|
||||
} else {
|
||||
if ($parsed.extDimensionAccountingFlag) { X "$indent`t`t<ExtDimensionAccountingFlag>$(Esc-Xml "$($parsed.extDimensionAccountingFlag)")</ExtDimensionAccountingFlag>" } else { X "$indent`t`t<ExtDimensionAccountingFlag/>" }
|
||||
if ($parsed.extDimensionAccountingFlag) { X "$indent`t`t<ExtDimensionAccountingFlag>$(Esc-XmlText "$($parsed.extDimensionAccountingFlag)")</ExtDimensionAccountingFlag>" } else { X "$indent`t`t<ExtDimensionAccountingFlag/>" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1960,7 +1964,7 @@ function Emit-Attribute {
|
||||
|
||||
# Реквизит адресации задачи: AddressingDimension (ссылка на измерение регистра исполнителей), между Indexing и FullTextSearch.
|
||||
if ($context -eq "task-addressing" -and $elemTag -eq "AddressingAttribute") {
|
||||
if ($parsed.addressingDimension) { X "$indent`t`t<AddressingDimension>$(Esc-Xml "$($parsed.addressingDimension)")</AddressingDimension>" } else { X "$indent`t`t<AddressingDimension/>" }
|
||||
if ($parsed.addressingDimension) { X "$indent`t`t<AddressingDimension>$(Esc-XmlText "$($parsed.addressingDimension)")</AddressingDimension>" } else { X "$indent`t`t<AddressingDimension/>" }
|
||||
}
|
||||
$fts = if ($parsed.fullTextSearch) { $parsed.fullTextSearch } else { "Use" }
|
||||
X "$indent`t`t<FullTextSearch>$fts</FullTextSearch>"
|
||||
@@ -2003,8 +2007,8 @@ function Emit-CommandPicture {
|
||||
}
|
||||
if (-not $src) { X "$indent<Picture/>"; return }
|
||||
X "$indent<Picture>"
|
||||
if ($src -match '^abs:(.*)$') { X "$indent`t<xr:Abs>$(Esc-Xml $matches[1])</xr:Abs>" }
|
||||
else { X "$indent`t<xr:Ref>$(Esc-Xml $src)</xr:Ref>" }
|
||||
if ($src -match '^abs:(.*)$') { X "$indent`t<xr:Abs>$(Esc-XmlText $matches[1])</xr:Abs>" }
|
||||
else { X "$indent`t<xr:Ref>$(Esc-XmlText $src)</xr:Ref>" }
|
||||
X "$indent`t<xr:LoadTransparent>$(if ($lt) { 'true' } else { 'false' })</xr:LoadTransparent>"
|
||||
if ($tpx) { X "$indent`t<xr:TransparentPixel x=`"$($tpx.x)`" y=`"$($tpx.y)`"/>" }
|
||||
X "$indent</Picture>"
|
||||
@@ -2018,7 +2022,7 @@ function Emit-Command {
|
||||
param([string]$indent, [string]$cmdName, $cmd)
|
||||
X "$indent<Command uuid=`"$(New-Guid-String)`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $cmdName)</Name>"
|
||||
X "$indent`t`t<Name>$(Esc-XmlText $cmdName)</Name>"
|
||||
$syn = if ($null -ne $cmd.synonym) { $cmd.synonym } else { Split-CamelCase $cmdName }
|
||||
Emit-MLText "$indent`t`t" "Synonym" $syn
|
||||
if ($cmd.comment) { X "$indent`t`t<Comment>$(Esc-XmlText "$($cmd.comment)")</Comment>" } else { X "$indent`t`t<Comment/>" }
|
||||
@@ -2027,7 +2031,7 @@ function Emit-Command {
|
||||
Write-Error "Команда '$cmdName': тип параметра (commandParameterType) недоступен для команд командного интерфейса раздела ('$group'). Тип параметра — только для групп формы (FormCommandBar*/FormNavigationPanel*) или CommandGroup.<Имя>."
|
||||
exit 1
|
||||
}
|
||||
X "$indent`t`t<Group>$(Esc-Xml $group)</Group>"
|
||||
X "$indent`t`t<Group>$(Esc-XmlText $group)</Group>"
|
||||
if ($cmd.commandParameterType) {
|
||||
X "$indent`t`t<CommandParameterType>"
|
||||
Emit-TypeContent "$indent`t`t`t" "$($cmd.commandParameterType)"
|
||||
@@ -2043,7 +2047,7 @@ function Emit-Command {
|
||||
X "$indent`t`t<Representation>$rep</Representation>"
|
||||
Emit-MLText "$indent`t`t" "ToolTip" $cmd.tooltip
|
||||
Emit-CommandPicture "$indent`t`t" $cmd
|
||||
if ($cmd.shortcut) { X "$indent`t`t<Shortcut>$(Esc-Xml "$($cmd.shortcut)")</Shortcut>" } else { X "$indent`t`t<Shortcut/>" }
|
||||
if ($cmd.shortcut) { X "$indent`t`t<Shortcut>$(Esc-XmlText "$($cmd.shortcut)")</Shortcut>" } else { X "$indent`t`t<Shortcut/>" }
|
||||
$osu = if ($cmd.onMainServerUnavalableBehavior) { "$($cmd.onMainServerUnavalableBehavior)" } else { "Auto" }
|
||||
X "$indent`t`t<OnMainServerUnavalableBehavior>$osu</OnMainServerUnavalableBehavior>"
|
||||
X "$indent`t</Properties>"
|
||||
@@ -2075,7 +2079,7 @@ function Emit-TabularSection {
|
||||
$tsSynonym = if ($null -ne $tsSynonymArg) { $tsSynonymArg } else { Split-CamelCase $tsName }
|
||||
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $tsName)</Name>"
|
||||
X "$indent`t`t<Name>$(Esc-XmlText $tsName)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $tsSynonym
|
||||
if ($tsComment) { X "$indent`t`t<Comment>$(Esc-XmlText $tsComment)</Comment>" } else { X "$indent`t`t<Comment/>" }
|
||||
Emit-MLText "$indent`t`t" "ToolTip" $tsTooltip
|
||||
@@ -2121,7 +2125,7 @@ function Emit-EnumValue {
|
||||
$uuid = New-Guid-String
|
||||
X "$indent<EnumValue uuid=`"$uuid`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $parsed.name)</Name>"
|
||||
X "$indent`t`t<Name>$(Esc-XmlText $parsed.name)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $parsed.synonym
|
||||
if ($parsed.comment) { X "$indent`t`t<Comment>$(Esc-XmlText $parsed.comment)</Comment>" } else { X "$indent`t`t<Comment/>" }
|
||||
X "$indent`t</Properties>"
|
||||
@@ -2136,7 +2140,7 @@ function Emit-Dimension {
|
||||
$uuid = New-Guid-String
|
||||
X "$indent<Dimension uuid=`"$uuid`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $parsed.name)</Name>"
|
||||
X "$indent`t`t<Name>$(Esc-XmlText $parsed.name)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $parsed.synonym
|
||||
X "$indent`t`t<Comment/>"
|
||||
|
||||
@@ -2178,7 +2182,7 @@ function Emit-Dimension {
|
||||
X "$indent`t`t<ChoiceParameters/>"
|
||||
X "$indent`t`t<QuickChoice>Auto</QuickChoice>"
|
||||
X "$indent`t`t<CreateOnInput>Auto</CreateOnInput>"
|
||||
if ($parsed.choiceForm) { X "$indent`t`t<ChoiceForm>$(Esc-Xml "$($parsed.choiceForm)")</ChoiceForm>" } else { X "$indent`t`t<ChoiceForm/>" }
|
||||
if ($parsed.choiceForm) { X "$indent`t`t<ChoiceForm>$(Esc-XmlText "$($parsed.choiceForm)")</ChoiceForm>" } else { X "$indent`t`t<ChoiceForm/>" }
|
||||
X "$indent`t`t<LinkByType/>"
|
||||
X "$indent`t`t<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>"
|
||||
|
||||
@@ -2226,7 +2230,7 @@ function Emit-Resource {
|
||||
$uuid = New-Guid-String
|
||||
X "$indent<Resource uuid=`"$uuid`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $parsed.name)</Name>"
|
||||
X "$indent`t`t<Name>$(Esc-XmlText $parsed.name)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $parsed.synonym
|
||||
X "$indent`t`t<Comment/>"
|
||||
|
||||
@@ -2272,7 +2276,7 @@ function Emit-Resource {
|
||||
X "$indent`t`t<ChoiceParameters/>"
|
||||
X "$indent`t`t<QuickChoice>Auto</QuickChoice>"
|
||||
X "$indent`t`t<CreateOnInput>Auto</CreateOnInput>"
|
||||
if ($parsed.choiceForm) { X "$indent`t`t<ChoiceForm>$(Esc-Xml "$($parsed.choiceForm)")</ChoiceForm>" } else { X "$indent`t`t<ChoiceForm/>" }
|
||||
if ($parsed.choiceForm) { X "$indent`t`t<ChoiceForm>$(Esc-XmlText "$($parsed.choiceForm)")</ChoiceForm>" } else { X "$indent`t`t<ChoiceForm/>" }
|
||||
X "$indent`t`t<LinkByType/>"
|
||||
X "$indent`t`t<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>"
|
||||
|
||||
@@ -2298,7 +2302,7 @@ function Emit-CatalogProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
|
||||
@@ -2317,7 +2321,7 @@ function Emit-CatalogProperties {
|
||||
if ($def.owners -and $def.owners.Count -gt 0) {
|
||||
X "$i<Owners>"
|
||||
foreach ($ownerRef in $def.owners) {
|
||||
X "$i`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-Xml (Normalize-MDObjectRef "$ownerRef" 'Catalog'))</xr:Item>"
|
||||
X "$i`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-XmlText (Normalize-MDObjectRef "$ownerRef" 'Catalog'))</xr:Item>"
|
||||
}
|
||||
X "$i</Owners>"
|
||||
} else {
|
||||
@@ -2403,12 +2407,12 @@ function Emit-DocumentProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
X "$i<UseStandardCommands>$useStdCmd</UseStandardCommands>"
|
||||
if ($def.numerator) { X "$i<Numerator>$(Esc-Xml "$($def.numerator)")</Numerator>" } else { X "$i<Numerator/>" }
|
||||
if ($def.numerator) { X "$i<Numerator>$(Esc-XmlText "$($def.numerator)")</Numerator>" } else { X "$i<Numerator/>" }
|
||||
|
||||
$numberType = Get-EnumProp "NumberType" "numberType" "String"
|
||||
$numberLength = if ($null -ne $def.numberLength) { "$($def.numberLength)" } else { "11" }
|
||||
@@ -2468,7 +2472,7 @@ function Emit-DocumentProperties {
|
||||
}
|
||||
if ($regRecords.Count -gt 0) {
|
||||
X "$i<RegisterRecords>"
|
||||
foreach ($rr in $regRecords) { X "$i`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-Xml (Normalize-MDObjectRef "$rr"))</xr:Item>" }
|
||||
foreach ($rr in $regRecords) { X "$i`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-XmlText (Normalize-MDObjectRef "$rr"))</xr:Item>" }
|
||||
X "$i</RegisterRecords>"
|
||||
} else {
|
||||
X "$i<RegisterRecords/>"
|
||||
@@ -2502,7 +2506,7 @@ function Emit-EnumProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmds = if (Get-BoolProp "useStandardCommands" $false) { "true" } else { "false" }
|
||||
@@ -2528,7 +2532,7 @@ function Emit-ConstantProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
|
||||
@@ -2558,7 +2562,7 @@ function Emit-ConstantProperties {
|
||||
Emit-ChoiceParameterLinks $i $def.choiceParameterLinks
|
||||
Emit-ChoiceParameters $i $def.choiceParameters
|
||||
X "$i<QuickChoice>$(Get-EnumProp 'QuickChoice' 'quickChoice' 'Auto')</QuickChoice>"
|
||||
if ($def.choiceForm) { X "$i<ChoiceForm>$(Esc-Xml "$($def.choiceForm)")</ChoiceForm>" } else { X "$i<ChoiceForm/>" }
|
||||
if ($def.choiceForm) { X "$i<ChoiceForm>$(Esc-XmlText "$($def.choiceForm)")</ChoiceForm>" } else { X "$i<ChoiceForm/>" }
|
||||
Emit-LinkByType $i $def.linkByType
|
||||
X "$i<ChoiceHistoryOnInput>$(Get-EnumProp 'ChoiceHistoryOnInput' 'choiceHistoryOnInput' 'Auto')</ChoiceHistoryOnInput>"
|
||||
|
||||
@@ -2572,7 +2576,7 @@ function Emit-InformationRegisterProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
@@ -2623,7 +2627,7 @@ function Emit-AccumulationRegisterProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
@@ -2659,7 +2663,7 @@ function Emit-DefinedTypeProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
|
||||
@@ -2675,13 +2679,13 @@ function Emit-FunctionalOptionProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
# Location — хранилище значения опции (Constant.X / InformationRegister.X.Resource.Y / <Тип>.X.Attribute.Y).
|
||||
# Ссылка verbatim (MDObjectRef-путь; принимаем location или value).
|
||||
$loc = if ($def.location) { "$($def.location)" } elseif ($def.value) { "$($def.value)" } else { "" }
|
||||
if ($loc) { X "$i<Location>$(Esc-Xml (Normalize-MDObjectRef $loc))</Location>" } else { X "$i<Location/>" }
|
||||
if ($loc) { X "$i<Location>$(Esc-XmlText (Normalize-MDObjectRef $loc))</Location>" } else { X "$i<Location/>" }
|
||||
# PrivilegedGetMode — привилегированный режим чтения (корпус 2864/2864 = true → дефолт true).
|
||||
X "$i<PrivilegedGetMode>$(if (Get-BoolProp 'privilegedGetMode' $true) { 'true' } else { 'false' })</PrivilegedGetMode>"
|
||||
# Content — объекты, зависящие от опции (список MDObjectRef-путей к реквизитам/измерениям/ресурсам). omit-on-empty.
|
||||
@@ -2689,7 +2693,7 @@ function Emit-FunctionalOptionProperties {
|
||||
if ($def.content) { $content = @($def.content) }
|
||||
if ($content.Count -gt 0) {
|
||||
X "$i<Content>"
|
||||
foreach ($obj in $content) { X "$i`t<xr:Object>$(Esc-Xml (Normalize-MDObjectRef "$obj"))</xr:Object>" }
|
||||
foreach ($obj in $content) { X "$i`t<xr:Object>$(Esc-XmlText (Normalize-MDObjectRef "$obj"))</xr:Object>" }
|
||||
X "$i</Content>"
|
||||
} else {
|
||||
X "$i<Content/>"
|
||||
@@ -2702,7 +2706,7 @@ function Emit-MDRefList {
|
||||
$arr = @(); if ($items) { $arr = @($items) }
|
||||
if ($arr.Count -gt 0) {
|
||||
X "$indent<$tag>"
|
||||
foreach ($it in $arr) { X "$indent`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-Xml (Normalize-MDObjectRef "$it"))</xr:Item>" }
|
||||
foreach ($it in $arr) { X "$indent`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-XmlText (Normalize-MDObjectRef "$it"))</xr:Item>" }
|
||||
X "$indent</$tag>"
|
||||
} else {
|
||||
X "$indent<$tag/>"
|
||||
@@ -2712,7 +2716,7 @@ function Emit-MDRefList {
|
||||
function Emit-SequenceProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
X "$i<MoveBoundaryOnPosting>$(Get-EnumProp 'MoveBoundaryOnPosting' 'moveBoundaryOnPosting' 'DontMove')</MoveBoundaryOnPosting>"
|
||||
@@ -2724,7 +2728,7 @@ function Emit-SequenceProperties {
|
||||
function Emit-FilterCriterionProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
$vt = if ($def.valueType) { "$($def.valueType)" } elseif ($def.valueTypes) { (@($def.valueTypes) | ForEach-Object { "$_" }) -join ' + ' } else { '' }
|
||||
@@ -2735,7 +2739,7 @@ function Emit-FilterCriterionProperties {
|
||||
$content = @(); if ($def.content) { $content = @($def.content) }
|
||||
if ($content.Count -gt 0) {
|
||||
X "$i<Content>"
|
||||
foreach ($obj in $content) { X "$i`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-Xml (Normalize-MDObjectRef "$obj"))</xr:Item>" }
|
||||
foreach ($obj in $content) { X "$i`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-XmlText (Normalize-MDObjectRef "$obj"))</xr:Item>" }
|
||||
X "$i</Content>"
|
||||
} else {
|
||||
X "$i<Content/>"
|
||||
@@ -2750,7 +2754,7 @@ function Emit-FilterCriterionProperties {
|
||||
function Emit-DocumentNumeratorProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
X "$i<NumberType>$(Get-EnumProp 'NumberType' 'numberType' 'String')</NumberType>"
|
||||
@@ -2763,7 +2767,7 @@ function Emit-DocumentNumeratorProperties {
|
||||
function Emit-SettingsStorageProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
Emit-VerbatimRef $i "DefaultSaveForm" $def.defaultSaveForm
|
||||
@@ -2775,7 +2779,7 @@ function Emit-SettingsStorageProperties {
|
||||
function Emit-CommonFormProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
X "$i<FormType>$(Get-EnumProp 'FormType' 'formType' 'Managed')</FormType>"
|
||||
@@ -2799,7 +2803,7 @@ function Emit-CommonFormProperties {
|
||||
function Emit-SessionParameterProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
$vt = if ($def.valueType) { "$($def.valueType)" } elseif ($def.valueTypes) { (@($def.valueTypes) | ForEach-Object { "$_" }) -join ' + ' } else { '' }
|
||||
@@ -2809,7 +2813,7 @@ function Emit-SessionParameterProperties {
|
||||
function Emit-FunctionalOptionsParameterProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
# Use — измерения регистров/реквизиты, к которым привязан параметр (список MDObjectRef).
|
||||
@@ -2819,7 +2823,7 @@ function Emit-FunctionalOptionsParameterProperties {
|
||||
function Emit-WSReferenceProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
$url = if ($def.locationURL) { "$($def.locationURL)" } elseif ($def.locationUrl) { "$($def.locationUrl)" } else { "" }
|
||||
@@ -2829,7 +2833,7 @@ function Emit-WSReferenceProperties {
|
||||
function Emit-CommonPictureProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
X "$i<AvailabilityForChoice>$(if (Get-BoolProp 'availabilityForChoice' $false) { 'true' } else { 'false' })</AvailabilityForChoice>"
|
||||
@@ -2839,7 +2843,7 @@ function Emit-CommonPictureProperties {
|
||||
function Emit-CommonTemplateProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
X "$i<TemplateType>$(Get-EnumProp 'TemplateType' 'templateType' 'SpreadsheetDocument')</TemplateType>"
|
||||
@@ -2848,7 +2852,7 @@ function Emit-CommonTemplateProperties {
|
||||
function Emit-CommandGroupProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
X "$i<Representation>$(Get-EnumProp 'Representation' 'representation' 'Auto')</Representation>"
|
||||
@@ -2860,15 +2864,15 @@ function Emit-CommandGroupProperties {
|
||||
function Emit-CommonCommandProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
$group = if ($def.group) { "$($def.group)" } else { "" }
|
||||
if ($group) { X "$i<Group>$(Esc-Xml $group)</Group>" } else { X "$i<Group/>" }
|
||||
if ($group) { X "$i<Group>$(Esc-XmlText $group)</Group>" } else { X "$i<Group/>" }
|
||||
X "$i<Representation>$(Get-EnumProp 'Representation' 'representation' 'Auto')</Representation>"
|
||||
Emit-MLText $i "ToolTip" $def.tooltip
|
||||
Emit-CommandPicture $i $def
|
||||
if ($def.shortcut) { X "$i<Shortcut>$(Esc-Xml "$($def.shortcut)")</Shortcut>" } else { X "$i<Shortcut/>" }
|
||||
if ($def.shortcut) { X "$i<Shortcut>$(Esc-XmlText "$($def.shortcut)")</Shortcut>" } else { X "$i<Shortcut/>" }
|
||||
$inclHelp = if (Get-BoolProp "includeHelpInContents" $false) { "true" } else { "false" }
|
||||
X "$i<IncludeHelpInContents>$inclHelp</IncludeHelpInContents>"
|
||||
if ($def.commandParameterType) {
|
||||
@@ -2886,7 +2890,7 @@ function Emit-CommonCommandProperties {
|
||||
function Emit-CommonAttributeProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
# Дефолт типа — String(0) (переменная длина 0), НЕ $def.type (это тип метаобъекта «CommonAttribute»).
|
||||
@@ -2911,7 +2915,7 @@ function Emit-CommonAttributeProperties {
|
||||
Emit-ChoiceParameters $i $def.choiceParameters
|
||||
X "$i<QuickChoice>$(Get-EnumProp 'QuickChoice' 'quickChoice' 'Auto')</QuickChoice>"
|
||||
X "$i<CreateOnInput>$(Get-EnumProp 'CreateOnInput' 'createOnInput' 'Auto')</CreateOnInput>"
|
||||
if ($def.choiceForm) { X "$i<ChoiceForm>$(Esc-Xml "$($def.choiceForm)")</ChoiceForm>" } else { X "$i<ChoiceForm/>" }
|
||||
if ($def.choiceForm) { X "$i<ChoiceForm>$(Esc-XmlText "$($def.choiceForm)")</ChoiceForm>" } else { X "$i<ChoiceForm/>" }
|
||||
Emit-LinkByType $i $def.linkByType
|
||||
X "$i<ChoiceHistoryOnInput>$(Get-EnumProp 'ChoiceHistoryOnInput' 'choiceHistoryOnInput' 'Auto')</ChoiceHistoryOnInput>"
|
||||
# Content — объекты, к которым добавлен общий реквизит: {metadata, use?, conditionalSeparation?}.
|
||||
@@ -2922,10 +2926,10 @@ function Emit-CommonAttributeProperties {
|
||||
$md = if ($c -is [string]) { "$c" } else { "$($c.metadata)" }
|
||||
$use = if ($c -is [string]) { 'Use' } elseif ($c.use) { "$($c.use)" } else { 'Use' }
|
||||
X "$i`t<xr:Item>"
|
||||
X "$i`t`t<xr:Metadata>$(Esc-Xml (Normalize-MDObjectRef $md))</xr:Metadata>"
|
||||
X "$i`t`t<xr:Metadata>$(Esc-XmlText (Normalize-MDObjectRef $md))</xr:Metadata>"
|
||||
X "$i`t`t<xr:Use>$use</xr:Use>"
|
||||
$cs = if ($c -isnot [string] -and $c.conditionalSeparation) { "$($c.conditionalSeparation)" } else { "" }
|
||||
if ($cs) { X "$i`t`t<xr:ConditionalSeparation>$(Esc-Xml $cs)</xr:ConditionalSeparation>" } else { X "$i`t`t<xr:ConditionalSeparation/>" }
|
||||
if ($cs) { X "$i`t`t<xr:ConditionalSeparation>$(Esc-XmlText $cs)</xr:ConditionalSeparation>" } else { X "$i`t`t<xr:ConditionalSeparation/>" }
|
||||
X "$i`t</xr:Item>"
|
||||
}
|
||||
X "$i</Content>"
|
||||
@@ -2936,11 +2940,11 @@ function Emit-CommonAttributeProperties {
|
||||
X "$i<DataSeparation>$(Get-EnumProp 'DataSeparation' 'dataSeparation' 'DontUse')</DataSeparation>"
|
||||
X "$i<SeparatedDataUse>$(Get-EnumProp 'SeparatedDataUse' 'separatedDataUse' 'Independently')</SeparatedDataUse>"
|
||||
$dsv = if ($def.dataSeparationValue) { "$($def.dataSeparationValue)" } else { "" }
|
||||
if ($dsv) { X "$i<DataSeparationValue>$(Esc-Xml $dsv)</DataSeparationValue>" } else { X "$i<DataSeparationValue/>" }
|
||||
if ($dsv) { X "$i<DataSeparationValue>$(Esc-XmlText $dsv)</DataSeparationValue>" } else { X "$i<DataSeparationValue/>" }
|
||||
$dsu = if ($def.dataSeparationUse) { "$($def.dataSeparationUse)" } else { "" }
|
||||
if ($dsu) { X "$i<DataSeparationUse>$(Esc-Xml $dsu)</DataSeparationUse>" } else { X "$i<DataSeparationUse/>" }
|
||||
if ($dsu) { X "$i<DataSeparationUse>$(Esc-XmlText $dsu)</DataSeparationUse>" } else { X "$i<DataSeparationUse/>" }
|
||||
$cs2 = if ($def.conditionalSeparation) { "$($def.conditionalSeparation)" } else { "" }
|
||||
if ($cs2) { X "$i<ConditionalSeparation>$(Esc-Xml $cs2)</ConditionalSeparation>" } else { X "$i<ConditionalSeparation/>" }
|
||||
if ($cs2) { X "$i<ConditionalSeparation>$(Esc-XmlText $cs2)</ConditionalSeparation>" } else { X "$i<ConditionalSeparation/>" }
|
||||
X "$i<UsersSeparation>$(Get-EnumProp 'UsersSeparation' 'usersSeparation' 'DontUse')</UsersSeparation>"
|
||||
X "$i<AuthenticationSeparation>$(Get-EnumProp 'AuthenticationSeparation' 'authenticationSeparation' 'DontUse')</AuthenticationSeparation>"
|
||||
X "$i<ConfigurationExtensionsSeparation>$(Get-EnumProp 'ConfigurationExtensionsSeparation' 'configurationExtensionsSeparation' 'DontUse')</ConfigurationExtensionsSeparation>"
|
||||
@@ -2957,7 +2961,7 @@ function Emit-SequenceDimension {
|
||||
$parsed = Parse-AttributeShorthand $dimDef
|
||||
X "$indent<Dimension uuid=`"$uuid`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $parsed.name)</Name>"
|
||||
X "$indent`t`t<Name>$(Esc-XmlText $parsed.name)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $parsed.synonym
|
||||
if ($parsed.comment) { X "$indent`t`t<Comment>$(Esc-XmlText $parsed.comment)</Comment>" } else { X "$indent`t`t<Comment/>" }
|
||||
if ($parsed.typeEmpty) { X "$indent`t`t<Type/>" }
|
||||
@@ -2975,7 +2979,7 @@ function Emit-CommonModuleProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
|
||||
@@ -3017,7 +3021,7 @@ function Emit-ScheduledJobProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
|
||||
@@ -3026,14 +3030,14 @@ function Emit-ScheduledJobProperties {
|
||||
if ($methodName -and -not $methodName.StartsWith("CommonModule.")) {
|
||||
$methodName = "CommonModule.$methodName"
|
||||
}
|
||||
X "$i<MethodName>$(Esc-Xml $methodName)</MethodName>"
|
||||
X "$i<MethodName>$(Esc-XmlText $methodName)</MethodName>"
|
||||
|
||||
# Description — плоская строка (дефолт ПУСТО: корпус 662 пустых / 209 заданы; не подставляем синоним — иначе роундтрип рвётся).
|
||||
$description = if ($def.description) { "$($def.description)" } else { "" }
|
||||
if ($description) { X "$i<Description>$(Esc-XmlText $description)</Description>" } else { X "$i<Description/>" }
|
||||
|
||||
$key = if ($def.key) { "$($def.key)" } else { "" }
|
||||
X "$i<Key>$(Esc-Xml $key)</Key>"
|
||||
X "$i<Key>$(Esc-XmlText $key)</Key>"
|
||||
|
||||
$use = if ($def.use -eq $true) { "true" } else { "false" }
|
||||
X "$i<Use>$use</Use>"
|
||||
@@ -3051,7 +3055,7 @@ function Emit-EventSubscriptionProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
|
||||
@@ -3075,7 +3079,7 @@ function Emit-EventSubscriptionProperties {
|
||||
if ($handler -and -not $handler.StartsWith("CommonModule.")) {
|
||||
$handler = "CommonModule.$handler"
|
||||
}
|
||||
X "$i<Handler>$(Esc-Xml $handler)</Handler>"
|
||||
X "$i<Handler>$(Esc-XmlText $handler)</Handler>"
|
||||
}
|
||||
|
||||
# --- 13b. Wave 2: Report, DataProcessor ---
|
||||
@@ -3084,7 +3088,7 @@ function Emit-ReportProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
# UseStandardCommands: дефолт true (авторски-безопасно — доступность объекта через стандартный командный
|
||||
@@ -3110,7 +3114,7 @@ function Emit-DataProcessorProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmds = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
@@ -3130,7 +3134,7 @@ function Emit-ExchangePlanProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
@@ -3202,7 +3206,7 @@ function Emit-ChartOfCharacteristicTypesProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
@@ -3211,7 +3215,7 @@ function Emit-ChartOfCharacteristicTypesProperties {
|
||||
X "$i<IncludeHelpInContents>$inclHelp</IncludeHelpInContents>"
|
||||
|
||||
# CharacteristicExtValues — ссылка на справочник доп. значений характеристик (обычно пусто).
|
||||
if ($def.characteristicExtValues) { X "$i<CharacteristicExtValues>$(Esc-Xml "$($def.characteristicExtValues)")</CharacteristicExtValues>" }
|
||||
if ($def.characteristicExtValues) { X "$i<CharacteristicExtValues>$(Esc-XmlText "$($def.characteristicExtValues)")</CharacteristicExtValues>" }
|
||||
else { X "$i<CharacteristicExtValues/>" }
|
||||
|
||||
# Type — тип значения характеристики (составной). DSL `valueType` строка "A + B + C" ИЛИ массив; нет ключа → дефолт.
|
||||
@@ -3311,7 +3315,7 @@ function Emit-DocumentJournalProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText $def.comment)</Comment>" } else { X "$i<Comment/>" }
|
||||
|
||||
@@ -3325,7 +3329,7 @@ function Emit-DocumentJournalProperties {
|
||||
if ($def.registeredDocuments) { $regDocs = @($def.registeredDocuments) }
|
||||
if ($regDocs.Count -gt 0) {
|
||||
X "$i<RegisteredDocuments>"
|
||||
foreach ($rd in $regDocs) { X "$i`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-Xml (Normalize-MDObjectRef "$rd"))</xr:Item>" }
|
||||
foreach ($rd in $regDocs) { X "$i`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-XmlText (Normalize-MDObjectRef "$rd"))</xr:Item>" }
|
||||
X "$i</RegisteredDocuments>"
|
||||
} else {
|
||||
X "$i<RegisteredDocuments/>"
|
||||
@@ -3358,7 +3362,7 @@ function Emit-ChartOfAccountsProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
@@ -3369,7 +3373,7 @@ function Emit-ChartOfAccountsProperties {
|
||||
|
||||
# ExtDimensionTypes — ссылка на ПВХ видов субконто (прощающий ввод: ПланВидовХарактеристик.X → ChartOfCharacteristicTypes.X).
|
||||
$extDimTypes = if ($def.extDimensionTypes) { Resolve-TypePrefixSyn "$($def.extDimensionTypes)" } else { "" }
|
||||
if ($extDimTypes) { X "$i<ExtDimensionTypes>$(Esc-Xml $extDimTypes)</ExtDimensionTypes>" } else { X "$i<ExtDimensionTypes/>" }
|
||||
if ($extDimTypes) { X "$i<ExtDimensionTypes>$(Esc-XmlText $extDimTypes)</ExtDimensionTypes>" } else { X "$i<ExtDimensionTypes/>" }
|
||||
|
||||
# Количество субконто: без ПВХ (extDimensionTypes) платформа не даёт > 0 → дефолт 0; с ПВХ — 3.
|
||||
$maxExtDim = if ($null -ne $def.maxExtDimensionCount) { "$($def.maxExtDimensionCount)" } elseif ($extDimTypes) { "3" } else { "0" }
|
||||
@@ -3464,7 +3468,7 @@ function Emit-AccountingRegisterProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
@@ -3473,7 +3477,7 @@ function Emit-AccountingRegisterProperties {
|
||||
X "$i<IncludeHelpInContents>$inclHelp</IncludeHelpInContents>"
|
||||
|
||||
$chartOfAccounts = if ($def.chartOfAccounts) { "$($def.chartOfAccounts)" } else { "" }
|
||||
if ($chartOfAccounts) { X "$i<ChartOfAccounts>$(Esc-Xml $chartOfAccounts)</ChartOfAccounts>" }
|
||||
if ($chartOfAccounts) { X "$i<ChartOfAccounts>$(Esc-XmlText $chartOfAccounts)</ChartOfAccounts>" }
|
||||
else { X "$i<ChartOfAccounts/>" }
|
||||
|
||||
$correspondence = if ($def.correspondence -eq $true) { "true" } else { "false" }
|
||||
@@ -3537,7 +3541,7 @@ function Emit-ChartOfCalculationTypesProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
@@ -3582,7 +3586,7 @@ function Emit-ChartOfCalculationTypesProperties {
|
||||
$baseTypes = @(); if ($def.baseCalculationTypes) { $baseTypes = @($def.baseCalculationTypes | ForEach-Object { Resolve-TypePrefixSyn "$_" }) }
|
||||
if ($baseTypes.Count -gt 0) {
|
||||
X "$i<BaseCalculationTypes>"
|
||||
foreach ($bt in $baseTypes) { X "$i`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-Xml (Normalize-MDObjectRef "$bt"))</xr:Item>" }
|
||||
foreach ($bt in $baseTypes) { X "$i`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-XmlText (Normalize-MDObjectRef "$bt"))</xr:Item>" }
|
||||
X "$i</BaseCalculationTypes>"
|
||||
} else { X "$i<BaseCalculationTypes/>" }
|
||||
$actionPeriodUse = if ($def.actionPeriodUse -eq $true) { "true" } else { "false" }
|
||||
@@ -3616,7 +3620,7 @@ function Emit-CalculationRegisterProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
@@ -3634,16 +3638,16 @@ function Emit-CalculationRegisterProperties {
|
||||
X "$i<BasePeriod>$basePeriod</BasePeriod>"
|
||||
|
||||
$schedule = if ($def.schedule) { "$($def.schedule)" } else { "" }
|
||||
if ($schedule) { X "$i<Schedule>$(Esc-Xml $schedule)</Schedule>" } else { X "$i<Schedule/>" }
|
||||
if ($schedule) { X "$i<Schedule>$(Esc-XmlText $schedule)</Schedule>" } else { X "$i<Schedule/>" }
|
||||
|
||||
$scheduleValue = if ($def.scheduleValue) { "$($def.scheduleValue)" } else { "" }
|
||||
if ($scheduleValue) { X "$i<ScheduleValue>$(Esc-Xml $scheduleValue)</ScheduleValue>" } else { X "$i<ScheduleValue/>" }
|
||||
if ($scheduleValue) { X "$i<ScheduleValue>$(Esc-XmlText $scheduleValue)</ScheduleValue>" } else { X "$i<ScheduleValue/>" }
|
||||
|
||||
$scheduleDate = if ($def.scheduleDate) { "$($def.scheduleDate)" } else { "" }
|
||||
if ($scheduleDate) { X "$i<ScheduleDate>$(Esc-Xml $scheduleDate)</ScheduleDate>" } else { X "$i<ScheduleDate/>" }
|
||||
if ($scheduleDate) { X "$i<ScheduleDate>$(Esc-XmlText $scheduleDate)</ScheduleDate>" } else { X "$i<ScheduleDate/>" }
|
||||
|
||||
$chartOfCalcTypes = if ($def.chartOfCalculationTypes) { "$($def.chartOfCalculationTypes)" } else { "" }
|
||||
if ($chartOfCalcTypes) { X "$i<ChartOfCalculationTypes>$(Esc-Xml $chartOfCalcTypes)</ChartOfCalculationTypes>" }
|
||||
if ($chartOfCalcTypes) { X "$i<ChartOfCalculationTypes>$(Esc-XmlText $chartOfCalcTypes)</ChartOfCalculationTypes>" }
|
||||
else { X "$i<ChartOfCalculationTypes/>" }
|
||||
|
||||
$inclHelp = if (Get-BoolProp "includeHelpInContents" $false) { "true" } else { "false" }
|
||||
@@ -3668,7 +3672,7 @@ function Emit-BusinessProcessProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
@@ -3707,7 +3711,7 @@ function Emit-BusinessProcessProperties {
|
||||
Emit-BasedOn $i $def.basedOn
|
||||
X "$i<NumberPeriodicity>$(Get-EnumProp 'NumberPeriodicity' 'numberPeriodicity' 'Nonperiodical')</NumberPeriodicity>"
|
||||
|
||||
if ($def.task) { X "$i<Task>$(Esc-Xml "$($def.task)")</Task>" } else { X "$i<Task/>" }
|
||||
if ($def.task) { X "$i<Task>$(Esc-XmlText "$($def.task)")</Task>" } else { X "$i<Task/>" }
|
||||
$createTaskPriv = if (Get-BoolProp "createTaskInPrivilegedMode" $true) { "true" } else { "false" }
|
||||
X "$i<CreateTaskInPrivilegedMode>$createTaskPriv</CreateTaskInPrivilegedMode>"
|
||||
|
||||
@@ -3733,7 +3737,7 @@ function Emit-BusinessProcessProperties {
|
||||
function Emit-TaskProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
$useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" }
|
||||
@@ -3752,9 +3756,9 @@ function Emit-TaskProperties {
|
||||
X "$i<Autonumbering>$autonumbering</Autonumbering>"
|
||||
X "$i<TaskNumberAutoPrefix>$taskNumberAutoPrefix</TaskNumberAutoPrefix>"
|
||||
X "$i<DescriptionLength>$descriptionLength</DescriptionLength>"
|
||||
if ($def.addressing) { X "$i<Addressing>$(Esc-Xml "$($def.addressing)")</Addressing>" } else { X "$i<Addressing/>" }
|
||||
if ($def.mainAddressingAttribute) { X "$i<MainAddressingAttribute>$(Esc-Xml "$($def.mainAddressingAttribute)")</MainAddressingAttribute>" } else { X "$i<MainAddressingAttribute/>" }
|
||||
if ($def.currentPerformer) { X "$i<CurrentPerformer>$(Esc-Xml "$($def.currentPerformer)")</CurrentPerformer>" } else { X "$i<CurrentPerformer/>" }
|
||||
if ($def.addressing) { X "$i<Addressing>$(Esc-XmlText "$($def.addressing)")</Addressing>" } else { X "$i<Addressing/>" }
|
||||
if ($def.mainAddressingAttribute) { X "$i<MainAddressingAttribute>$(Esc-XmlText "$($def.mainAddressingAttribute)")</MainAddressingAttribute>" } else { X "$i<MainAddressingAttribute/>" }
|
||||
if ($def.currentPerformer) { X "$i<CurrentPerformer>$(Esc-XmlText "$($def.currentPerformer)")</CurrentPerformer>" } else { X "$i<CurrentPerformer/>" }
|
||||
Emit-BasedOn $i $def.basedOn
|
||||
Emit-StandardAttributes $i "Task"
|
||||
Emit-Characteristics $i $def.characteristics
|
||||
@@ -3798,12 +3802,12 @@ function Emit-HTTPServiceProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-Xml "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
|
||||
$rootURL = if ($def.rootURL) { "$($def.rootURL)" } else { $objName.ToLower() }
|
||||
X "$i<RootURL>$(Esc-Xml $rootURL)</RootURL>"
|
||||
X "$i<RootURL>$(Esc-XmlText $rootURL)</RootURL>"
|
||||
|
||||
$reuseSessions = Get-EnumProp "ReuseSessions" "reuseSessions" "DontUse"
|
||||
X "$i<ReuseSessions>$reuseSessions</ReuseSessions>"
|
||||
@@ -3820,7 +3824,7 @@ function Emit-XDTOType {
|
||||
$uri = $Matches[1]; $local = $Matches[2]
|
||||
X "$indent<$tag xmlns:d1p1=`"$(Esc-Xml $uri)`">d1p1:$(Esc-Xml $local)</$tag>"
|
||||
} else {
|
||||
X "$indent<$tag>$(Esc-Xml $value)</$tag>"
|
||||
X "$indent<$tag>$(Esc-XmlText $value)</$tag>"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3828,12 +3832,12 @@ function Emit-WebServiceProperties {
|
||||
param([string]$indent)
|
||||
$i = $indent
|
||||
|
||||
X "$i<Name>$(Esc-Xml $objName)</Name>"
|
||||
X "$i<Name>$(Esc-XmlText $objName)</Name>"
|
||||
Emit-MLText $i "Synonym" $synonym
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-Xml "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
if ($def.comment) { X "$i<Comment>$(Esc-XmlText "$($def.comment)")</Comment>" } else { X "$i<Comment/>" }
|
||||
|
||||
$namespace = if ($def.namespace) { "$($def.namespace)" } else { "" }
|
||||
X "$i<Namespace>$(Esc-Xml $namespace)</Namespace>"
|
||||
X "$i<Namespace>$(Esc-XmlText $namespace)</Namespace>"
|
||||
|
||||
# XDTOPackages — СПИСОК элементов, а не скаляр: значение либо ссылка на пакет конфигурации
|
||||
# (xr:MDObjectRef "XDTOPackage.Имя"), либо URI внешнего пространства имён (xs:string).
|
||||
@@ -3848,7 +3852,7 @@ function Emit-WebServiceProperties {
|
||||
X "$i`t<xr:Item>"
|
||||
X "$i`t`t<xr:Presentation/>"
|
||||
X "$i`t`t<xr:CheckState>0</xr:CheckState>"
|
||||
X "$i`t`t<xr:Value xsi:type=`"$xt`">$(Esc-Xml $pv)</xr:Value>"
|
||||
X "$i`t`t<xr:Value xsi:type=`"$xt`">$(Esc-XmlText $pv)</xr:Value>"
|
||||
X "$i`t</xr:Item>"
|
||||
}
|
||||
X "$i</XDTOPackages>"
|
||||
@@ -3856,7 +3860,7 @@ function Emit-WebServiceProperties {
|
||||
|
||||
# Имя файла дескриптора не выводится из имени сервиса (DMILService → dmil.1cws) — только дефолт.
|
||||
$descriptor = if ($def.descriptorFileName) { "$($def.descriptorFileName)" } else { "$objName.1cws" }
|
||||
X "$i<DescriptorFileName>$(Esc-Xml $descriptor)</DescriptorFileName>"
|
||||
X "$i<DescriptorFileName>$(Esc-XmlText $descriptor)</DescriptorFileName>"
|
||||
|
||||
$reuseSessions = Get-EnumProp "ReuseSessions" "reuseSessions" "DontUse"
|
||||
X "$i<ReuseSessions>$reuseSessions</ReuseSessions>"
|
||||
@@ -3890,14 +3894,14 @@ function Emit-Column {
|
||||
|
||||
X "$indent<Column uuid=`"$uuid`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $name)</Name>"
|
||||
X "$indent`t`t<Name>$(Esc-XmlText $name)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $synonym
|
||||
if ($comment) { X "$indent`t`t<Comment>$(Esc-XmlText $comment)</Comment>" } else { X "$indent`t`t<Comment/>" }
|
||||
X "$indent`t`t<Indexing>$indexing</Indexing>"
|
||||
if ($references.Count -gt 0) {
|
||||
X "$indent`t`t<References>"
|
||||
foreach ($ref in $references) {
|
||||
X "$indent`t`t`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-Xml (Normalize-MDObjectRef "$ref"))</xr:Item>"
|
||||
X "$indent`t`t`t<xr:Item xsi:type=`"xr:MDObjectRef`">$(Esc-XmlText (Normalize-MDObjectRef "$ref"))</xr:Item>"
|
||||
}
|
||||
X "$indent`t`t</References>"
|
||||
} else {
|
||||
@@ -3933,10 +3937,10 @@ function Emit-URLTemplate {
|
||||
|
||||
X "$indent<URLTemplate uuid=`"$uuid`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $tmplName)</Name>"
|
||||
X "$indent`t`t<Name>$(Esc-XmlText $tmplName)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $tmplSynonym
|
||||
if ($tmplComment) { X "$indent`t`t<Comment>$(Esc-Xml $tmplComment)</Comment>" } else { X "$indent`t`t<Comment/>" }
|
||||
X "$indent`t`t<Template>$(Esc-Xml $template)</Template>"
|
||||
if ($tmplComment) { X "$indent`t`t<Comment>$(Esc-XmlText $tmplComment)</Comment>" } else { X "$indent`t`t<Comment/>" }
|
||||
X "$indent`t`t<Template>$(Esc-XmlText $template)</Template>"
|
||||
X "$indent`t</Properties>"
|
||||
|
||||
if ($methods.Count -gt 0) {
|
||||
@@ -3959,11 +3963,11 @@ function Emit-URLTemplate {
|
||||
|
||||
X "$indent`t`t<Method uuid=`"$methodUuid`">"
|
||||
X "$indent`t`t`t<Properties>"
|
||||
X "$indent`t`t`t`t<Name>$(Esc-Xml $methodName)</Name>"
|
||||
X "$indent`t`t`t`t<Name>$(Esc-XmlText $methodName)</Name>"
|
||||
Emit-MLText "$indent`t`t`t`t" "Synonym" $methodSynonym
|
||||
if ($methodComment) { X "$indent`t`t`t`t<Comment>$(Esc-Xml $methodComment)</Comment>" } else { X "$indent`t`t`t`t<Comment/>" }
|
||||
if ($methodComment) { X "$indent`t`t`t`t<Comment>$(Esc-XmlText $methodComment)</Comment>" } else { X "$indent`t`t`t`t<Comment/>" }
|
||||
X "$indent`t`t`t`t<HTTPMethod>$httpMethod</HTTPMethod>"
|
||||
X "$indent`t`t`t`t<Handler>$(Esc-Xml $handler)</Handler>"
|
||||
X "$indent`t`t`t`t<Handler>$(Esc-XmlText $handler)</Handler>"
|
||||
X "$indent`t`t`t</Properties>"
|
||||
X "$indent`t`t</Method>"
|
||||
}
|
||||
@@ -4009,13 +4013,13 @@ function Emit-Operation {
|
||||
|
||||
X "$indent<Operation uuid=`"$uuid`">"
|
||||
X "$indent`t<Properties>"
|
||||
X "$indent`t`t<Name>$(Esc-Xml $opName)</Name>"
|
||||
X "$indent`t`t<Name>$(Esc-XmlText $opName)</Name>"
|
||||
Emit-MLText "$indent`t`t" "Synonym" $opSynonym
|
||||
if ($opComment) { X "$indent`t`t<Comment>$(Esc-Xml $opComment)</Comment>" } else { X "$indent`t`t<Comment/>" }
|
||||
if ($opComment) { X "$indent`t`t<Comment>$(Esc-XmlText $opComment)</Comment>" } else { X "$indent`t`t<Comment/>" }
|
||||
Emit-XDTOType "$indent`t`t" "XDTOReturningValueType" $returnType
|
||||
X "$indent`t`t<Nillable>$nillable</Nillable>"
|
||||
X "$indent`t`t<Transactioned>$transactioned</Transactioned>"
|
||||
X "$indent`t`t<ProcedureName>$(Esc-Xml $handler)</ProcedureName>"
|
||||
X "$indent`t`t<ProcedureName>$(Esc-XmlText $handler)</ProcedureName>"
|
||||
X "$indent`t`t<DataLockControlMode>$dataLock</DataLockControlMode>"
|
||||
X "$indent`t</Properties>"
|
||||
|
||||
@@ -4042,9 +4046,9 @@ function Emit-Operation {
|
||||
|
||||
X "$indent`t`t<Parameter uuid=`"$paramUuid`">"
|
||||
X "$indent`t`t`t<Properties>"
|
||||
X "$indent`t`t`t`t<Name>$(Esc-Xml $paramName)</Name>"
|
||||
X "$indent`t`t`t`t<Name>$(Esc-XmlText $paramName)</Name>"
|
||||
Emit-MLText "$indent`t`t`t`t" "Synonym" $paramSynonym
|
||||
if ($paramComment) { X "$indent`t`t`t`t<Comment>$(Esc-Xml $paramComment)</Comment>" } else { X "$indent`t`t`t`t<Comment/>" }
|
||||
if ($paramComment) { X "$indent`t`t`t`t<Comment>$(Esc-XmlText $paramComment)</Comment>" } else { X "$indent`t`t`t`t<Comment/>" }
|
||||
Emit-XDTOType "$indent`t`t`t`t" "XDTOValueType" $paramType
|
||||
X "$indent`t`t`t`t<Nillable>$paramNillable</Nillable>"
|
||||
X "$indent`t`t`t`t<TransferDirection>$paramDir</TransferDirection>"
|
||||
@@ -4861,7 +4865,7 @@ if ($objType -eq "ExchangePlan") {
|
||||
[void]$sbC.Append("<ExchangePlanContent $xepNs version=`"$($script:formatVersion)`">`r`n")
|
||||
foreach ($it in $cItems) {
|
||||
[void]$sbC.Append("`t<Item>`r`n")
|
||||
[void]$sbC.Append("`t`t<Metadata>$(Esc-Xml $it.metadata)</Metadata>`r`n")
|
||||
[void]$sbC.Append("`t`t<Metadata>$(Esc-XmlText $it.metadata)</Metadata>`r`n")
|
||||
[void]$sbC.Append("`t`t<AutoRecord>$($it.autoRecord)</AutoRecord>`r`n")
|
||||
[void]$sbC.Append("`t</Item>`r`n")
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# meta-compile v1.73 — Compile 1C metadata object from JSON
|
||||
# meta-compile v1.74 — Compile 1C metadata object from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
|
||||
import argparse
|
||||
@@ -520,7 +520,7 @@ def normalize_form_ref(s):
|
||||
def emit_form_ref(i, tag, val):
|
||||
"""Ссылка на форму по умолчанию: непустая → <Tag>значение</Tag>, иначе <Tag/>."""
|
||||
if val:
|
||||
X(f'{i}<{tag}>{esc_xml(normalize_form_ref(str(val)))}</{tag}>')
|
||||
X(f'{i}<{tag}>{esc_xml_text(normalize_form_ref(str(val)))}</{tag}>')
|
||||
else:
|
||||
X(f'{i}<{tag}/>')
|
||||
|
||||
@@ -528,7 +528,7 @@ def emit_verbatim_ref(i, tag, val):
|
||||
"""Ссылка verbatim (без normalize_form_ref): формы/схемы/хранилища Report/DataProcessor, где имя формы
|
||||
может быть буквально «Форма» (normalize перевёл бы имя-сегмент Форма→Form) либо ref не-форменного вида."""
|
||||
if val:
|
||||
X(f'{i}<{tag}>{esc_xml(str(val))}</{tag}>')
|
||||
X(f'{i}<{tag}>{esc_xml_text(str(val))}</{tag}>')
|
||||
else:
|
||||
X(f'{i}<{tag}/>')
|
||||
|
||||
@@ -1338,7 +1338,7 @@ def emit_standard_attribute(indent, attr_name, ov=None):
|
||||
lbt_dp = str(lbt.get('dataPath')) if isinstance(lbt, dict) else str(lbt)
|
||||
lbt_li = lbt.get('linkItem', 0) if isinstance(lbt, dict) else 0
|
||||
X(f'{indent}\t<xr:LinkByType>')
|
||||
X(f'{indent}\t\t<xr:DataPath>{esc_xml(lbt_dp)}</xr:DataPath>')
|
||||
X(f'{indent}\t\t<xr:DataPath>{esc_xml_text(lbt_dp)}</xr:DataPath>')
|
||||
X(f'{indent}\t\t<xr:LinkItem>{lbt_li}</xr:LinkItem>')
|
||||
X(f'{indent}\t</xr:LinkByType>')
|
||||
else:
|
||||
@@ -1357,7 +1357,7 @@ def emit_standard_attribute(indent, attr_name, ov=None):
|
||||
X(f'{indent}\t<xr:ExtendedEdit>false</xr:ExtendedEdit>')
|
||||
emit_mltext(f'{indent}\t', 'xr:Format', fmt)
|
||||
if cf:
|
||||
X(f'{indent}\t<xr:ChoiceForm>{esc_xml(str(cf))}</xr:ChoiceForm>')
|
||||
X(f'{indent}\t<xr:ChoiceForm>{esc_xml_text(str(cf))}</xr:ChoiceForm>')
|
||||
else:
|
||||
X(f'{indent}\t<xr:ChoiceForm/>')
|
||||
X(f'{indent}\t<xr:QuickChoice>Auto</xr:QuickChoice>')
|
||||
@@ -1386,7 +1386,7 @@ def emit_standard_attribute(indent, attr_name, ov=None):
|
||||
if fv_tx == '' or fv_tx is None:
|
||||
X(f'{indent}\t<xr:FillValue xsi:type="{fv_xt}"/>')
|
||||
else:
|
||||
X(f'{indent}\t<xr:FillValue xsi:type="{fv_xt}">{esc_xml(fv_tx)}</xr:FillValue>')
|
||||
X(f'{indent}\t<xr:FillValue xsi:type="{fv_xt}">{esc_xml_text(fv_tx)}</xr:FillValue>')
|
||||
if msk:
|
||||
X(f'{indent}\t<xr:Mask>{esc_xml_text(str(msk))}</xr:Mask>')
|
||||
else:
|
||||
@@ -1591,7 +1591,7 @@ def emit_link_by_type(indent, spec):
|
||||
return
|
||||
dp = expand_data_path(dp)
|
||||
X(f'{indent}<LinkByType>')
|
||||
X(f'{indent}\t<xr:DataPath>{esc_xml(str(dp))}</xr:DataPath>')
|
||||
X(f'{indent}\t<xr:DataPath>{esc_xml_text(str(dp))}</xr:DataPath>')
|
||||
X(f'{indent}\t<xr:LinkItem>{li}</xr:LinkItem>')
|
||||
X(f'{indent}</LinkByType>')
|
||||
|
||||
@@ -1603,7 +1603,7 @@ def emit_field_block(indent, tag, fields):
|
||||
return
|
||||
X(f'{indent}<{tag}>')
|
||||
for f in arr:
|
||||
X(f'{indent}\t<xr:Field>{esc_xml(str(f))}</xr:Field>')
|
||||
X(f'{indent}\t<xr:Field>{esc_xml_text(str(f))}</xr:Field>')
|
||||
X(f'{indent}</{tag}>')
|
||||
|
||||
def emit_based_on(indent, items):
|
||||
@@ -1614,7 +1614,7 @@ def emit_based_on(indent, items):
|
||||
return
|
||||
X(f'{indent}<BasedOn>')
|
||||
for it in arr:
|
||||
X(f'{indent}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml(normalize_md_object_ref(str(it)))}</xr:Item>')
|
||||
X(f'{indent}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml_text(normalize_md_object_ref(str(it)))}</xr:Item>')
|
||||
X(f'{indent}</BasedOn>')
|
||||
|
||||
# --- Параметры/связи выбора (порт из form-compile) ---
|
||||
@@ -1752,14 +1752,14 @@ def emit_choice_parameters(indent, cp, tag='ChoiceParameters'):
|
||||
if tx == '' or tx is None:
|
||||
X(f'{indent}\t\t\t<v8:Value xsi:type="{xt}"/>')
|
||||
else:
|
||||
X(f'{indent}\t\t\t<v8:Value xsi:type="{xt}">{esc_xml(tx)}</v8:Value>')
|
||||
X(f'{indent}\t\t\t<v8:Value xsi:type="{xt}">{esc_xml_text(tx)}</v8:Value>')
|
||||
X(f'{indent}\t\t</app:value>')
|
||||
else:
|
||||
xt, tx = normalize_choice_value_t(val, ptype)
|
||||
if tx == '' or tx is None:
|
||||
X(f'{indent}\t\t<app:value xsi:type="{xt}"/>')
|
||||
else:
|
||||
X(f'{indent}\t\t<app:value xsi:type="{xt}">{esc_xml(tx)}</app:value>')
|
||||
X(f'{indent}\t\t<app:value xsi:type="{xt}">{esc_xml_text(tx)}</app:value>')
|
||||
X(f'{indent}\t</app:item>')
|
||||
X(f'{indent}</{tag}>')
|
||||
|
||||
@@ -1786,8 +1786,8 @@ def emit_choice_parameter_links(indent, cpl, tag='ChoiceParameterLinks'):
|
||||
else:
|
||||
vc = str(vc_raw)
|
||||
X(f'{indent}\t<xr:Link>')
|
||||
X(f'{indent}\t\t<xr:Name>{esc_xml(str(name))}</xr:Name>')
|
||||
X(f'{indent}\t\t<xr:DataPath xsi:type="xs:string">{esc_xml(str(dp))}</xr:DataPath>')
|
||||
X(f'{indent}\t\t<xr:Name>{esc_xml_text(str(name))}</xr:Name>')
|
||||
X(f'{indent}\t\t<xr:DataPath xsi:type="xs:string">{esc_xml_text(str(dp))}</xr:DataPath>')
|
||||
X(f'{indent}\t\t<xr:ValueChange>{vc}</xr:ValueChange>')
|
||||
X(f'{indent}\t</xr:Link>')
|
||||
X(f'{indent}</{tag}>')
|
||||
@@ -1863,8 +1863,8 @@ def emit_characteristics(indent, chars):
|
||||
mvo = char_int_field(values, ['multipleValuesOrderField'])
|
||||
X(f'{indent}\t<xr:Characteristic>')
|
||||
X(f'{indent}\t\t<xr:CharacteristicTypes from="{esc_xml(t_from)}">')
|
||||
X(f'{indent}\t\t\t<xr:KeyField>{esc_xml(key)}</xr:KeyField>')
|
||||
X(f'{indent}\t\t\t<xr:TypesFilterField>{esc_xml(tff)}</xr:TypesFilterField>')
|
||||
X(f'{indent}\t\t\t<xr:KeyField>{esc_xml_text(key)}</xr:KeyField>')
|
||||
X(f'{indent}\t\t\t<xr:TypesFilterField>{esc_xml_text(tff)}</xr:TypesFilterField>')
|
||||
# filterValue: None→nil; голое→xs:string, полный путь→DTR, bool→xs:boolean.
|
||||
tfv_raw = ch_el_prop(types, ['filterValue', 'typesFilterValue'])
|
||||
if tfv_raw is None:
|
||||
@@ -1874,14 +1874,14 @@ def emit_characteristics(indent, chars):
|
||||
if tfv_tx == '' or tfv_tx is None:
|
||||
X(f'{indent}\t\t\t<xr:TypesFilterValue xsi:type="{tfv_xt}"/>')
|
||||
else:
|
||||
X(f'{indent}\t\t\t<xr:TypesFilterValue xsi:type="{tfv_xt}">{esc_xml(tfv_tx)}</xr:TypesFilterValue>')
|
||||
X(f'{indent}\t\t\t<xr:TypesFilterValue xsi:type="{tfv_xt}">{esc_xml_text(tfv_tx)}</xr:TypesFilterValue>')
|
||||
X(f'{indent}\t\t\t<xr:DataPathField>{dpf}</xr:DataPathField>')
|
||||
X(f'{indent}\t\t\t<xr:MultipleValuesUseField>{mvu}</xr:MultipleValuesUseField>')
|
||||
X(f'{indent}\t\t</xr:CharacteristicTypes>')
|
||||
X(f'{indent}\t\t<xr:CharacteristicValues from="{esc_xml(v_from)}">')
|
||||
X(f'{indent}\t\t\t<xr:ObjectField>{esc_xml(obj)}</xr:ObjectField>')
|
||||
X(f'{indent}\t\t\t<xr:TypeField>{esc_xml(typ)}</xr:TypeField>')
|
||||
X(f'{indent}\t\t\t<xr:ValueField>{esc_xml(val)}</xr:ValueField>')
|
||||
X(f'{indent}\t\t\t<xr:ObjectField>{esc_xml_text(obj)}</xr:ObjectField>')
|
||||
X(f'{indent}\t\t\t<xr:TypeField>{esc_xml_text(typ)}</xr:TypeField>')
|
||||
X(f'{indent}\t\t\t<xr:ValueField>{esc_xml_text(val)}</xr:ValueField>')
|
||||
X(f'{indent}\t\t\t<xr:MultipleValuesKeyField>{mvk}</xr:MultipleValuesKeyField>')
|
||||
X(f'{indent}\t\t\t<xr:MultipleValuesOrderField>{mvo}</xr:MultipleValuesOrderField>')
|
||||
X(f'{indent}\t\t</xr:CharacteristicValues>')
|
||||
@@ -1894,7 +1894,7 @@ def emit_min_max_value(indent, tag, val):
|
||||
X(f'{indent}<{tag} xsi:nil="true"/>')
|
||||
return
|
||||
t = 'xs:string' if isinstance(val, str) else 'xs:decimal'
|
||||
X(f'{indent}<{tag} xsi:type="{t}">{esc_xml(str(val))}</{tag}>')
|
||||
X(f'{indent}<{tag} xsi:type="{t}">{esc_xml_text(str(val))}</{tag}>')
|
||||
|
||||
def emit_attribute(indent, parsed, context, elem_tag='Attribute'):
|
||||
# context: "catalog", "document", "object", "processor", "tabular", "processor-tabular", "register",
|
||||
@@ -1911,7 +1911,7 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'):
|
||||
uid = new_uuid()
|
||||
X(f'{indent}<{elem_tag} uuid="{uid}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(parsed["name"])}</Name>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml_text(parsed["name"])}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', parsed['synonym'])
|
||||
if parsed.get('comment'):
|
||||
X(f'{indent}\t\t<Comment>{esc_xml_text(parsed["comment"])}</Comment>')
|
||||
@@ -1965,7 +1965,7 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'):
|
||||
emit_choice_parameters(f'{indent}\t\t', parsed.get('choiceParameters'))
|
||||
X(f'{indent}\t\t<QuickChoice>{parsed.get("quickChoice") or "Auto"}</QuickChoice>')
|
||||
X(f'{indent}\t\t<CreateOnInput>{parsed.get("createOnInput") or "Auto"}</CreateOnInput>')
|
||||
X(f'{indent}\t\t<ChoiceForm>{esc_xml(str(parsed["choiceForm"]))}</ChoiceForm>' if parsed.get('choiceForm') else f'{indent}\t\t<ChoiceForm/>')
|
||||
X(f'{indent}\t\t<ChoiceForm>{esc_xml_text(str(parsed["choiceForm"]))}</ChoiceForm>' if parsed.get('choiceForm') else f'{indent}\t\t<ChoiceForm/>')
|
||||
emit_link_by_type(f'{indent}\t\t', parsed.get('linkByType'))
|
||||
chi = parsed.get('choiceHistoryOnInput') or 'Auto'
|
||||
X(f'{indent}\t\t<ChoiceHistoryOnInput>{chi}</ChoiceHistoryOnInput>')
|
||||
@@ -1990,7 +1990,7 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'):
|
||||
# Регистр расчёта: ScheduleLink у измерений и реквизитов (НЕ ресурсов), перед Indexing. Дефолт пустой.
|
||||
if context == 'register-calc' and elem_tag in ('Dimension', 'Attribute'):
|
||||
if parsed.get('scheduleLink'):
|
||||
X(f'{indent}\t\t<ScheduleLink>{esc_xml(str(parsed["scheduleLink"]))}</ScheduleLink>')
|
||||
X(f'{indent}\t\t<ScheduleLink>{esc_xml_text(str(parsed["scheduleLink"]))}</ScheduleLink>')
|
||||
else:
|
||||
X(f'{indent}\t\t<ScheduleLink/>')
|
||||
# Измерение/ресурс регистра бухгалтерии: Balance + AccountingFlag, затем DenyIncompleteValues (изм.) / ExtDimensionAccountingFlag (рес.).
|
||||
@@ -1998,7 +1998,7 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'):
|
||||
balance = 'true' if (parsed.get('balance') is True or 'balance' in parsed.get('flags', [])) else 'false'
|
||||
X(f'{indent}\t\t<Balance>{balance}</Balance>')
|
||||
if parsed.get('accountingFlag'):
|
||||
X(f'{indent}\t\t<AccountingFlag>{esc_xml(str(parsed["accountingFlag"]))}</AccountingFlag>')
|
||||
X(f'{indent}\t\t<AccountingFlag>{esc_xml_text(str(parsed["accountingFlag"]))}</AccountingFlag>')
|
||||
else:
|
||||
X(f'{indent}\t\t<AccountingFlag/>')
|
||||
if elem_tag == 'Dimension':
|
||||
@@ -2006,7 +2006,7 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'):
|
||||
X(f'{indent}\t\t<DenyIncompleteValues>{deny_incomplete}</DenyIncompleteValues>')
|
||||
else:
|
||||
if parsed.get('extDimensionAccountingFlag'):
|
||||
X(f'{indent}\t\t<ExtDimensionAccountingFlag>{esc_xml(str(parsed["extDimensionAccountingFlag"]))}</ExtDimensionAccountingFlag>')
|
||||
X(f'{indent}\t\t<ExtDimensionAccountingFlag>{esc_xml_text(str(parsed["extDimensionAccountingFlag"]))}</ExtDimensionAccountingFlag>')
|
||||
else:
|
||||
X(f'{indent}\t\t<ExtDimensionAccountingFlag/>')
|
||||
if context == 'catalog':
|
||||
@@ -2027,7 +2027,7 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'):
|
||||
# Реквизит адресации задачи: AddressingDimension (между Indexing и FullTextSearch).
|
||||
if context == 'task-addressing' and elem_tag == 'AddressingAttribute':
|
||||
if parsed.get('addressingDimension'):
|
||||
X(f'{indent}\t\t<AddressingDimension>{esc_xml(str(parsed["addressingDimension"]))}</AddressingDimension>')
|
||||
X(f'{indent}\t\t<AddressingDimension>{esc_xml_text(str(parsed["addressingDimension"]))}</AddressingDimension>')
|
||||
else:
|
||||
X(f'{indent}\t\t<AddressingDimension/>')
|
||||
X(f'{indent}\t\t<FullTextSearch>{parsed.get("fullTextSearch") or "Use"}</FullTextSearch>')
|
||||
@@ -2074,9 +2074,9 @@ def emit_command_picture(indent, cmd):
|
||||
X(f'{indent}<Picture>')
|
||||
m = re.match(r'^abs:(.*)$', src)
|
||||
if m:
|
||||
X(f'{indent}\t<xr:Abs>{esc_xml(m.group(1))}</xr:Abs>')
|
||||
X(f'{indent}\t<xr:Abs>{esc_xml_text(m.group(1))}</xr:Abs>')
|
||||
else:
|
||||
X(f'{indent}\t<xr:Ref>{esc_xml(src)}</xr:Ref>')
|
||||
X(f'{indent}\t<xr:Ref>{esc_xml_text(src)}</xr:Ref>')
|
||||
X(f'{indent}\t<xr:LoadTransparent>{"true" if lt else "false"}</xr:LoadTransparent>')
|
||||
if tpx:
|
||||
X(f'{indent}\t<xr:TransparentPixel x="{tpx.get("x")}" y="{tpx.get("y")}"/>')
|
||||
@@ -2085,7 +2085,7 @@ def emit_command_picture(indent, cmd):
|
||||
def emit_command(indent, cmd_name, cmd):
|
||||
X(f'{indent}<Command uuid="{new_uuid()}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(cmd_name)}</Name>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml_text(cmd_name)}</Name>')
|
||||
syn = cmd['synonym'] if cmd.get('synonym') is not None else split_camel_case(cmd_name)
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', syn)
|
||||
if cmd.get('comment'):
|
||||
@@ -2098,7 +2098,7 @@ def emit_command(indent, cmd_name, cmd):
|
||||
f"командного интерфейса раздела ('{group}'). Тип параметра — только для групп формы "
|
||||
f"(FormCommandBar*/FormNavigationPanel*) или CommandGroup.<Имя>.\n")
|
||||
sys.exit(1)
|
||||
X(f'{indent}\t\t<Group>{esc_xml(group)}</Group>')
|
||||
X(f'{indent}\t\t<Group>{esc_xml_text(group)}</Group>')
|
||||
if cmd.get('commandParameterType'):
|
||||
X(f'{indent}\t\t<CommandParameterType>')
|
||||
emit_type_content(f'{indent}\t\t\t', str(cmd['commandParameterType']))
|
||||
@@ -2111,7 +2111,7 @@ def emit_command(indent, cmd_name, cmd):
|
||||
emit_mltext(f'{indent}\t\t', 'ToolTip', cmd.get('tooltip'))
|
||||
emit_command_picture(f'{indent}\t\t', cmd)
|
||||
if cmd.get('shortcut'):
|
||||
X(f'{indent}\t\t<Shortcut>{esc_xml(str(cmd["shortcut"]))}</Shortcut>')
|
||||
X(f'{indent}\t\t<Shortcut>{esc_xml_text(str(cmd["shortcut"]))}</Shortcut>')
|
||||
else:
|
||||
X(f'{indent}\t\t<Shortcut/>')
|
||||
X(f'{indent}\t\t<OnMainServerUnavalableBehavior>{cmd.get("onMainServerUnavalableBehavior") or "Auto"}</OnMainServerUnavalableBehavior>')
|
||||
@@ -2135,7 +2135,7 @@ def emit_tabular_section(indent, ts_name, columns, object_type, object_name, ts_
|
||||
X(f'{indent}\t</InternalInfo>')
|
||||
ts_synonym = ts_synonym_arg if ts_synonym_arg is not None else split_camel_case(ts_name)
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(ts_name)}</Name>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml_text(ts_name)}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', ts_synonym)
|
||||
if ts_comment:
|
||||
X(f'{indent}\t\t<Comment>{esc_xml_text(ts_comment)}</Comment>')
|
||||
@@ -2174,7 +2174,7 @@ def emit_enum_value(indent, parsed):
|
||||
uid = new_uuid()
|
||||
X(f'{indent}<EnumValue uuid="{uid}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(parsed["name"])}</Name>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml_text(parsed["name"])}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', parsed['synonym'])
|
||||
if parsed.get('comment'):
|
||||
X(f'{indent}\t\t<Comment>{esc_xml_text(parsed["comment"])}</Comment>')
|
||||
@@ -2191,7 +2191,7 @@ def emit_dimension(indent, parsed, register_type):
|
||||
uid = new_uuid()
|
||||
X(f'{indent}<Dimension uuid="{uid}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(parsed["name"])}</Name>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml_text(parsed["name"])}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', parsed['synonym'])
|
||||
X(f'{indent}\t\t<Comment/>')
|
||||
type_str = parsed['type']
|
||||
@@ -2227,7 +2227,7 @@ def emit_dimension(indent, parsed, register_type):
|
||||
X(f'{indent}\t\t<ChoiceParameters/>')
|
||||
X(f'{indent}\t\t<QuickChoice>Auto</QuickChoice>')
|
||||
X(f'{indent}\t\t<CreateOnInput>Auto</CreateOnInput>')
|
||||
X(f'{indent}\t\t<ChoiceForm>{esc_xml(str(parsed["choiceForm"]))}</ChoiceForm>' if parsed.get('choiceForm') else f'{indent}\t\t<ChoiceForm/>')
|
||||
X(f'{indent}\t\t<ChoiceForm>{esc_xml_text(str(parsed["choiceForm"]))}</ChoiceForm>' if parsed.get('choiceForm') else f'{indent}\t\t<ChoiceForm/>')
|
||||
X(f'{indent}\t\t<LinkByType/>')
|
||||
X(f'{indent}\t\t<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>')
|
||||
if register_type == 'InformationRegister':
|
||||
@@ -2261,7 +2261,7 @@ def emit_resource(indent, parsed, register_type):
|
||||
uid = new_uuid()
|
||||
X(f'{indent}<Resource uuid="{uid}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(parsed["name"])}</Name>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml_text(parsed["name"])}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', parsed['synonym'])
|
||||
X(f'{indent}\t\t<Comment/>')
|
||||
type_str = parsed['type']
|
||||
@@ -2301,7 +2301,7 @@ def emit_resource(indent, parsed, register_type):
|
||||
X(f'{indent}\t\t<ChoiceParameters/>')
|
||||
X(f'{indent}\t\t<QuickChoice>Auto</QuickChoice>')
|
||||
X(f'{indent}\t\t<CreateOnInput>Auto</CreateOnInput>')
|
||||
X(f'{indent}\t\t<ChoiceForm>{esc_xml(str(parsed["choiceForm"]))}</ChoiceForm>' if parsed.get('choiceForm') else f'{indent}\t\t<ChoiceForm/>')
|
||||
X(f'{indent}\t\t<ChoiceForm>{esc_xml_text(str(parsed["choiceForm"]))}</ChoiceForm>' if parsed.get('choiceForm') else f'{indent}\t\t<ChoiceForm/>')
|
||||
X(f'{indent}\t\t<LinkByType/>')
|
||||
X(f'{indent}\t\t<ChoiceHistoryOnInput>Auto</ChoiceHistoryOnInput>')
|
||||
if register_type == 'InformationRegister':
|
||||
@@ -2319,7 +2319,7 @@ def emit_resource(indent, parsed, register_type):
|
||||
|
||||
def emit_catalog_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -2341,7 +2341,7 @@ def emit_catalog_properties(indent):
|
||||
if owners:
|
||||
X(f'{i}<Owners>')
|
||||
for owner_ref in owners:
|
||||
X(f'{i}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml(normalize_md_object_ref(str(owner_ref), "Catalog"))}</xr:Item>')
|
||||
X(f'{i}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml_text(normalize_md_object_ref(str(owner_ref), "Catalog"))}</xr:Item>')
|
||||
X(f'{i}</Owners>')
|
||||
else:
|
||||
X(f'{i}<Owners/>')
|
||||
@@ -2416,7 +2416,7 @@ def emit_catalog_properties(indent):
|
||||
|
||||
def emit_document_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -2425,7 +2425,7 @@ def emit_document_properties(indent):
|
||||
use_std_cmd = 'true' if get_bool_prop('useStandardCommands', True) else 'false'
|
||||
X(f'{i}<UseStandardCommands>{use_std_cmd}</UseStandardCommands>')
|
||||
if defn.get('numerator'):
|
||||
X(f'{i}<Numerator>{esc_xml(str(defn["numerator"]))}</Numerator>')
|
||||
X(f'{i}<Numerator>{esc_xml_text(str(defn["numerator"]))}</Numerator>')
|
||||
else:
|
||||
X(f'{i}<Numerator/>')
|
||||
number_type = get_enum_prop('NumberType', 'numberType', 'String')
|
||||
@@ -2481,7 +2481,7 @@ def emit_document_properties(indent):
|
||||
if reg_records:
|
||||
X(f'{i}<RegisterRecords>')
|
||||
for rr in reg_records:
|
||||
X(f'{i}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml(normalize_md_object_ref(str(rr)))}</xr:Item>')
|
||||
X(f'{i}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml_text(normalize_md_object_ref(str(rr)))}</xr:Item>')
|
||||
X(f'{i}</RegisterRecords>')
|
||||
else:
|
||||
X(f'{i}<RegisterRecords/>')
|
||||
@@ -2509,7 +2509,7 @@ def emit_document_properties(indent):
|
||||
|
||||
def emit_enum_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(defn["comment"])}</Comment>')
|
||||
@@ -2533,7 +2533,7 @@ def emit_enum_properties(indent):
|
||||
|
||||
def emit_constant_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -2571,7 +2571,7 @@ def emit_constant_properties(indent):
|
||||
emit_choice_parameters(i, defn.get('choiceParameters'))
|
||||
X(f'{i}<QuickChoice>{get_enum_prop("QuickChoice", "quickChoice", "Auto")}</QuickChoice>')
|
||||
if defn.get('choiceForm'):
|
||||
X(f'{i}<ChoiceForm>{esc_xml(str(defn["choiceForm"]))}</ChoiceForm>')
|
||||
X(f'{i}<ChoiceForm>{esc_xml_text(str(defn["choiceForm"]))}</ChoiceForm>')
|
||||
else:
|
||||
X(f'{i}<ChoiceForm/>')
|
||||
emit_link_by_type(i, defn.get('linkByType'))
|
||||
@@ -2583,7 +2583,7 @@ def emit_constant_properties(indent):
|
||||
|
||||
def emit_information_register_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -2626,7 +2626,7 @@ def emit_information_register_properties(indent):
|
||||
|
||||
def emit_accumulation_register_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -2655,7 +2655,7 @@ def emit_accumulation_register_properties(indent):
|
||||
|
||||
def emit_defined_type_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -2675,7 +2675,7 @@ def emit_defined_type_properties(indent):
|
||||
|
||||
def emit_functional_option_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -2684,7 +2684,7 @@ def emit_functional_option_properties(indent):
|
||||
# Location — хранилище значения опции (ссылка verbatim; location или value).
|
||||
loc = str(defn['location']) if defn.get('location') else (str(defn['value']) if defn.get('value') else '')
|
||||
if loc:
|
||||
X(f'{i}<Location>{esc_xml(normalize_md_object_ref(loc))}</Location>')
|
||||
X(f'{i}<Location>{esc_xml_text(normalize_md_object_ref(loc))}</Location>')
|
||||
else:
|
||||
X(f'{i}<Location/>')
|
||||
# PrivilegedGetMode — дефолт true (корпус 2864/2864).
|
||||
@@ -2694,7 +2694,7 @@ def emit_functional_option_properties(indent):
|
||||
if content:
|
||||
X(f'{i}<Content>')
|
||||
for obj in content:
|
||||
X(f'{i}\t<xr:Object>{esc_xml(normalize_md_object_ref(str(obj)))}</xr:Object>')
|
||||
X(f'{i}\t<xr:Object>{esc_xml_text(normalize_md_object_ref(str(obj)))}</xr:Object>')
|
||||
X(f'{i}</Content>')
|
||||
else:
|
||||
X(f'{i}<Content/>')
|
||||
@@ -2705,14 +2705,14 @@ def emit_md_ref_list(indent, tag, items):
|
||||
if arr:
|
||||
X(f'{indent}<{tag}>')
|
||||
for it in arr:
|
||||
X(f'{indent}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml(normalize_md_object_ref(str(it)))}</xr:Item>')
|
||||
X(f'{indent}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml_text(normalize_md_object_ref(str(it)))}</xr:Item>')
|
||||
X(f'{indent}</{tag}>')
|
||||
else:
|
||||
X(f'{indent}<{tag}/>')
|
||||
|
||||
def emit_sequence_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -2725,7 +2725,7 @@ def emit_sequence_properties(indent):
|
||||
|
||||
def emit_filter_criterion_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -2747,7 +2747,7 @@ def emit_filter_criterion_properties(indent):
|
||||
if content:
|
||||
X(f'{i}<Content>')
|
||||
for obj in content:
|
||||
X(f'{i}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml(normalize_md_object_ref(str(obj)))}</xr:Item>')
|
||||
X(f'{i}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml_text(normalize_md_object_ref(str(obj)))}</xr:Item>')
|
||||
X(f'{i}</Content>')
|
||||
else:
|
||||
X(f'{i}<Content/>')
|
||||
@@ -2759,7 +2759,7 @@ def emit_filter_criterion_properties(indent):
|
||||
|
||||
def emit_document_numerator_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -2774,7 +2774,7 @@ def emit_document_numerator_properties(indent):
|
||||
|
||||
def emit_settings_storage_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -2787,7 +2787,7 @@ def emit_settings_storage_properties(indent):
|
||||
|
||||
def emit_common_form_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -2817,7 +2817,7 @@ def _emit_comment(i):
|
||||
|
||||
def emit_session_parameter_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
_emit_comment(i)
|
||||
if defn.get('valueType'):
|
||||
@@ -2833,14 +2833,14 @@ def emit_session_parameter_properties(indent):
|
||||
|
||||
def emit_functional_options_parameter_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
_emit_comment(i)
|
||||
emit_md_ref_list(i, 'Use', defn.get('use'))
|
||||
|
||||
def emit_ws_reference_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
_emit_comment(i)
|
||||
url = str(defn['locationURL']) if defn.get('locationURL') else (str(defn['locationUrl']) if defn.get('locationUrl') else '')
|
||||
@@ -2851,7 +2851,7 @@ def emit_ws_reference_properties(indent):
|
||||
|
||||
def emit_common_picture_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
_emit_comment(i)
|
||||
X(f'{i}<AvailabilityForChoice>{"true" if get_bool_prop("availabilityForChoice", False) else "false"}</AvailabilityForChoice>')
|
||||
@@ -2859,14 +2859,14 @@ def emit_common_picture_properties(indent):
|
||||
|
||||
def emit_common_template_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
_emit_comment(i)
|
||||
X(f'{i}<TemplateType>{get_enum_prop("TemplateType", "templateType", "SpreadsheetDocument")}</TemplateType>')
|
||||
|
||||
def emit_command_group_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
_emit_comment(i)
|
||||
X(f'{i}<Representation>{get_enum_prop("Representation", "representation", "Auto")}</Representation>')
|
||||
@@ -2876,19 +2876,19 @@ def emit_command_group_properties(indent):
|
||||
|
||||
def emit_common_command_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
_emit_comment(i)
|
||||
group = str(defn['group']) if defn.get('group') else ''
|
||||
if group:
|
||||
X(f'{i}<Group>{esc_xml(group)}</Group>')
|
||||
X(f'{i}<Group>{esc_xml_text(group)}</Group>')
|
||||
else:
|
||||
X(f'{i}<Group/>')
|
||||
X(f'{i}<Representation>{get_enum_prop("Representation", "representation", "Auto")}</Representation>')
|
||||
emit_mltext(i, 'ToolTip', defn.get('tooltip'))
|
||||
emit_command_picture(i, defn)
|
||||
if defn.get('shortcut'):
|
||||
X(f'{i}<Shortcut>{esc_xml(str(defn["shortcut"]))}</Shortcut>')
|
||||
X(f'{i}<Shortcut>{esc_xml_text(str(defn["shortcut"]))}</Shortcut>')
|
||||
else:
|
||||
X(f'{i}<Shortcut/>')
|
||||
incl_help = 'true' if get_bool_prop('includeHelpInContents', False) else 'false'
|
||||
@@ -2905,7 +2905,7 @@ def emit_common_command_properties(indent):
|
||||
|
||||
def emit_common_attribute_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
_emit_comment(i)
|
||||
vt = str(defn['valueType']) if defn.get('valueType') else 'String(0)'
|
||||
@@ -2932,7 +2932,7 @@ def emit_common_attribute_properties(indent):
|
||||
X(f'{i}<QuickChoice>{get_enum_prop("QuickChoice", "quickChoice", "Auto")}</QuickChoice>')
|
||||
X(f'{i}<CreateOnInput>{get_enum_prop("CreateOnInput", "createOnInput", "Auto")}</CreateOnInput>')
|
||||
if defn.get('choiceForm'):
|
||||
X(f'{i}<ChoiceForm>{esc_xml(str(defn["choiceForm"]))}</ChoiceForm>')
|
||||
X(f'{i}<ChoiceForm>{esc_xml_text(str(defn["choiceForm"]))}</ChoiceForm>')
|
||||
else:
|
||||
X(f'{i}<ChoiceForm/>')
|
||||
emit_link_by_type(i, defn.get('linkByType'))
|
||||
@@ -2944,11 +2944,11 @@ def emit_common_attribute_properties(indent):
|
||||
md = c if isinstance(c, str) else str(c.get('metadata', ''))
|
||||
use = 'Use' if isinstance(c, str) else (str(c['use']) if c.get('use') else 'Use')
|
||||
X(f'{i}\t<xr:Item>')
|
||||
X(f'{i}\t\t<xr:Metadata>{esc_xml(normalize_md_object_ref(md))}</xr:Metadata>')
|
||||
X(f'{i}\t\t<xr:Metadata>{esc_xml_text(normalize_md_object_ref(md))}</xr:Metadata>')
|
||||
X(f'{i}\t\t<xr:Use>{use}</xr:Use>')
|
||||
cs = '' if isinstance(c, str) else (str(c['conditionalSeparation']) if c.get('conditionalSeparation') else '')
|
||||
if cs:
|
||||
X(f'{i}\t\t<xr:ConditionalSeparation>{esc_xml(cs)}</xr:ConditionalSeparation>')
|
||||
X(f'{i}\t\t<xr:ConditionalSeparation>{esc_xml_text(cs)}</xr:ConditionalSeparation>')
|
||||
else:
|
||||
X(f'{i}\t\t<xr:ConditionalSeparation/>')
|
||||
X(f'{i}\t</xr:Item>')
|
||||
@@ -2959,11 +2959,11 @@ def emit_common_attribute_properties(indent):
|
||||
X(f'{i}<DataSeparation>{get_enum_prop("DataSeparation", "dataSeparation", "DontUse")}</DataSeparation>')
|
||||
X(f'{i}<SeparatedDataUse>{get_enum_prop("SeparatedDataUse", "separatedDataUse", "Independently")}</SeparatedDataUse>')
|
||||
dsv = str(defn['dataSeparationValue']) if defn.get('dataSeparationValue') else ''
|
||||
X(f'{i}<DataSeparationValue>{esc_xml(dsv)}</DataSeparationValue>' if dsv else f'{i}<DataSeparationValue/>')
|
||||
X(f'{i}<DataSeparationValue>{esc_xml_text(dsv)}</DataSeparationValue>' if dsv else f'{i}<DataSeparationValue/>')
|
||||
dsu = str(defn['dataSeparationUse']) if defn.get('dataSeparationUse') else ''
|
||||
X(f'{i}<DataSeparationUse>{esc_xml(dsu)}</DataSeparationUse>' if dsu else f'{i}<DataSeparationUse/>')
|
||||
X(f'{i}<DataSeparationUse>{esc_xml_text(dsu)}</DataSeparationUse>' if dsu else f'{i}<DataSeparationUse/>')
|
||||
cs2 = str(defn['conditionalSeparation']) if defn.get('conditionalSeparation') else ''
|
||||
X(f'{i}<ConditionalSeparation>{esc_xml(cs2)}</ConditionalSeparation>' if cs2 else f'{i}<ConditionalSeparation/>')
|
||||
X(f'{i}<ConditionalSeparation>{esc_xml_text(cs2)}</ConditionalSeparation>' if cs2 else f'{i}<ConditionalSeparation/>')
|
||||
X(f'{i}<UsersSeparation>{get_enum_prop("UsersSeparation", "usersSeparation", "DontUse")}</UsersSeparation>')
|
||||
X(f'{i}<AuthenticationSeparation>{get_enum_prop("AuthenticationSeparation", "authenticationSeparation", "DontUse")}</AuthenticationSeparation>')
|
||||
X(f'{i}<ConfigurationExtensionsSeparation>{get_enum_prop("ConfigurationExtensionsSeparation", "configurationExtensionsSeparation", "DontUse")}</ConfigurationExtensionsSeparation>')
|
||||
@@ -2976,7 +2976,7 @@ def emit_sequence_dimension(indent, dim_def):
|
||||
parsed = parse_attribute_shorthand(dim_def)
|
||||
X(f'{indent}<Dimension uuid="{uid}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(parsed["name"])}</Name>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml_text(parsed["name"])}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', parsed['synonym'])
|
||||
if parsed.get('comment'):
|
||||
X(f'{indent}\t\t<Comment>{esc_xml_text(parsed["comment"])}</Comment>')
|
||||
@@ -2997,7 +2997,7 @@ def emit_sequence_dimension(indent, dim_def):
|
||||
|
||||
def emit_common_module_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -3044,7 +3044,7 @@ def emit_common_module_properties(indent):
|
||||
|
||||
def emit_scheduled_job_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -3054,7 +3054,7 @@ def emit_scheduled_job_properties(indent):
|
||||
# Ensure CommonModule. prefix
|
||||
if method_name and not method_name.startswith('CommonModule.'):
|
||||
method_name = f'CommonModule.{method_name}'
|
||||
X(f'{i}<MethodName>{esc_xml(method_name)}</MethodName>')
|
||||
X(f'{i}<MethodName>{esc_xml_text(method_name)}</MethodName>')
|
||||
# Description — плоская строка (дефолт ПУСТО, не синоним — иначе роундтрип рвётся).
|
||||
description = str(defn['description']) if defn.get('description') else ''
|
||||
if description:
|
||||
@@ -3062,7 +3062,7 @@ def emit_scheduled_job_properties(indent):
|
||||
else:
|
||||
X(f'{i}<Description/>')
|
||||
key = str(defn['key']) if defn.get('key') else ''
|
||||
X(f'{i}<Key>{esc_xml(key)}</Key>')
|
||||
X(f'{i}<Key>{esc_xml_text(key)}</Key>')
|
||||
use = 'true' if defn.get('use') is True else 'false'
|
||||
X(f'{i}<Use>{use}</Use>')
|
||||
predefined = 'true' if defn.get('predefined') is True else 'false'
|
||||
@@ -3074,7 +3074,7 @@ def emit_scheduled_job_properties(indent):
|
||||
|
||||
def emit_event_subscription_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -3094,13 +3094,13 @@ def emit_event_subscription_properties(indent):
|
||||
# Ensure CommonModule. prefix
|
||||
if handler and not handler.startswith('CommonModule.'):
|
||||
handler = f'CommonModule.{handler}'
|
||||
X(f'{i}<Handler>{esc_xml(handler)}</Handler>')
|
||||
X(f'{i}<Handler>{esc_xml_text(handler)}</Handler>')
|
||||
|
||||
# --- 13b. Report, DataProcessor ---
|
||||
|
||||
def emit_report_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(defn["comment"])}</Comment>')
|
||||
@@ -3125,7 +3125,7 @@ def emit_report_properties(indent):
|
||||
|
||||
def emit_data_processor_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(defn["comment"])}</Comment>')
|
||||
@@ -3144,7 +3144,7 @@ def emit_data_processor_properties(indent):
|
||||
|
||||
def emit_exchange_plan_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -3205,7 +3205,7 @@ def emit_exchange_plan_properties(indent):
|
||||
|
||||
def emit_chart_of_characteristic_types_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -3214,7 +3214,7 @@ def emit_chart_of_characteristic_types_properties(indent):
|
||||
X(f'{i}<UseStandardCommands>{"true" if get_bool_prop("useStandardCommands", True) else "false"}</UseStandardCommands>')
|
||||
X(f'{i}<IncludeHelpInContents>{"true" if get_bool_prop("includeHelpInContents", False) else "false"}</IncludeHelpInContents>')
|
||||
if defn.get('characteristicExtValues'):
|
||||
X(f'{i}<CharacteristicExtValues>{esc_xml(str(defn["characteristicExtValues"]))}</CharacteristicExtValues>')
|
||||
X(f'{i}<CharacteristicExtValues>{esc_xml_text(str(defn["characteristicExtValues"]))}</CharacteristicExtValues>')
|
||||
else:
|
||||
X(f'{i}<CharacteristicExtValues/>')
|
||||
vt = defn.get('valueType')
|
||||
@@ -3300,7 +3300,7 @@ def emit_chart_of_characteristic_types_properties(indent):
|
||||
|
||||
def emit_document_journal_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -3314,7 +3314,7 @@ def emit_document_journal_properties(indent):
|
||||
if reg_docs:
|
||||
X(f'{i}<RegisteredDocuments>')
|
||||
for rd in reg_docs:
|
||||
X(f'{i}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml(normalize_md_object_ref(str(rd)))}</xr:Item>')
|
||||
X(f'{i}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml_text(normalize_md_object_ref(str(rd)))}</xr:Item>')
|
||||
X(f'{i}</RegisteredDocuments>')
|
||||
else:
|
||||
X(f'{i}<RegisteredDocuments/>')
|
||||
@@ -3336,7 +3336,7 @@ def resolve_type_prefix_syn(ref):
|
||||
|
||||
def emit_chart_of_accounts_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -3348,7 +3348,7 @@ def emit_chart_of_accounts_properties(indent):
|
||||
# ExtDimensionTypes — ссылка на ПВХ видов субконто (прощающий ввод: ПланВидовХарактеристик.X → ChartOfCharacteristicTypes.X).
|
||||
ext_dim_types = resolve_type_prefix_syn(str(defn['extDimensionTypes'])) if defn.get('extDimensionTypes') else ''
|
||||
if ext_dim_types:
|
||||
X(f'{i}<ExtDimensionTypes>{esc_xml(ext_dim_types)}</ExtDimensionTypes>')
|
||||
X(f'{i}<ExtDimensionTypes>{esc_xml_text(ext_dim_types)}</ExtDimensionTypes>')
|
||||
else:
|
||||
X(f'{i}<ExtDimensionTypes/>')
|
||||
# Количество субконто: без ПВХ (extDimensionTypes) платформа не даёт > 0 → дефолт 0; с ПВХ — 3.
|
||||
@@ -3433,7 +3433,7 @@ def emit_chart_of_accounts_properties(indent):
|
||||
|
||||
def emit_accounting_register_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -3443,7 +3443,7 @@ def emit_accounting_register_properties(indent):
|
||||
X(f'{i}<IncludeHelpInContents>{"true" if get_bool_prop("includeHelpInContents", False) else "false"}</IncludeHelpInContents>')
|
||||
chart_of_accounts = str(defn['chartOfAccounts']) if defn.get('chartOfAccounts') else ''
|
||||
if chart_of_accounts:
|
||||
X(f'{i}<ChartOfAccounts>{esc_xml(chart_of_accounts)}</ChartOfAccounts>')
|
||||
X(f'{i}<ChartOfAccounts>{esc_xml_text(chart_of_accounts)}</ChartOfAccounts>')
|
||||
else:
|
||||
X(f'{i}<ChartOfAccounts/>')
|
||||
correspondence = 'true' if defn.get('correspondence') is True else 'false'
|
||||
@@ -3492,7 +3492,7 @@ def emit_calc_types_std_tabular(i):
|
||||
|
||||
def emit_chart_of_calculation_types_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -3535,7 +3535,7 @@ def emit_chart_of_calculation_types_properties(indent):
|
||||
if base_types:
|
||||
X(f'{i}<BaseCalculationTypes>')
|
||||
for bt in base_types:
|
||||
X(f'{i}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml(normalize_md_object_ref(bt))}</xr:Item>')
|
||||
X(f'{i}\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml_text(normalize_md_object_ref(bt))}</xr:Item>')
|
||||
X(f'{i}</BaseCalculationTypes>')
|
||||
else:
|
||||
X(f'{i}<BaseCalculationTypes/>')
|
||||
@@ -3560,7 +3560,7 @@ def emit_chart_of_calculation_types_properties(indent):
|
||||
|
||||
def emit_calculation_register_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -3577,22 +3577,22 @@ def emit_calculation_register_properties(indent):
|
||||
X(f'{i}<BasePeriod>{base_period}</BasePeriod>')
|
||||
schedule = str(defn['schedule']) if defn.get('schedule') else ''
|
||||
if schedule:
|
||||
X(f'{i}<Schedule>{esc_xml(schedule)}</Schedule>')
|
||||
X(f'{i}<Schedule>{esc_xml_text(schedule)}</Schedule>')
|
||||
else:
|
||||
X(f'{i}<Schedule/>')
|
||||
schedule_value = str(defn['scheduleValue']) if defn.get('scheduleValue') else ''
|
||||
if schedule_value:
|
||||
X(f'{i}<ScheduleValue>{esc_xml(schedule_value)}</ScheduleValue>')
|
||||
X(f'{i}<ScheduleValue>{esc_xml_text(schedule_value)}</ScheduleValue>')
|
||||
else:
|
||||
X(f'{i}<ScheduleValue/>')
|
||||
schedule_date = str(defn['scheduleDate']) if defn.get('scheduleDate') else ''
|
||||
if schedule_date:
|
||||
X(f'{i}<ScheduleDate>{esc_xml(schedule_date)}</ScheduleDate>')
|
||||
X(f'{i}<ScheduleDate>{esc_xml_text(schedule_date)}</ScheduleDate>')
|
||||
else:
|
||||
X(f'{i}<ScheduleDate/>')
|
||||
chart_of_calc_types = str(defn['chartOfCalculationTypes']) if defn.get('chartOfCalculationTypes') else ''
|
||||
if chart_of_calc_types:
|
||||
X(f'{i}<ChartOfCalculationTypes>{esc_xml(chart_of_calc_types)}</ChartOfCalculationTypes>')
|
||||
X(f'{i}<ChartOfCalculationTypes>{esc_xml_text(chart_of_calc_types)}</ChartOfCalculationTypes>')
|
||||
else:
|
||||
X(f'{i}<ChartOfCalculationTypes/>')
|
||||
X(f'{i}<IncludeHelpInContents>{"true" if get_bool_prop("includeHelpInContents", False) else "false"}</IncludeHelpInContents>')
|
||||
@@ -3607,7 +3607,7 @@ def emit_calculation_register_properties(indent):
|
||||
|
||||
def emit_business_process_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -3646,7 +3646,7 @@ def emit_business_process_properties(indent):
|
||||
X(f'{i}<NumberPeriodicity>{get_enum_prop("NumberPeriodicity", "numberPeriodicity", "Nonperiodical")}</NumberPeriodicity>')
|
||||
task_ref = str(defn['task']) if defn.get('task') else ''
|
||||
if task_ref:
|
||||
X(f'{i}<Task>{esc_xml(task_ref)}</Task>')
|
||||
X(f'{i}<Task>{esc_xml_text(task_ref)}</Task>')
|
||||
else:
|
||||
X(f'{i}<Task/>')
|
||||
X(f'{i}<CreateTaskInPrivilegedMode>{"true" if get_bool_prop("createTaskInPrivilegedMode", True) else "false"}</CreateTaskInPrivilegedMode>')
|
||||
@@ -3666,7 +3666,7 @@ def emit_business_process_properties(indent):
|
||||
|
||||
def emit_task_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
if defn.get('comment'):
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>')
|
||||
@@ -3687,9 +3687,9 @@ def emit_task_properties(indent):
|
||||
X(f'{i}<Autonumbering>{autonumbering}</Autonumbering>')
|
||||
X(f'{i}<TaskNumberAutoPrefix>{task_number_auto_prefix}</TaskNumberAutoPrefix>')
|
||||
X(f'{i}<DescriptionLength>{description_length}</DescriptionLength>')
|
||||
X(f'{i}<Addressing>{esc_xml(str(defn["addressing"]))}</Addressing>' if defn.get('addressing') else f'{i}<Addressing/>')
|
||||
X(f'{i}<MainAddressingAttribute>{esc_xml(str(defn["mainAddressingAttribute"]))}</MainAddressingAttribute>' if defn.get('mainAddressingAttribute') else f'{i}<MainAddressingAttribute/>')
|
||||
X(f'{i}<CurrentPerformer>{esc_xml(str(defn["currentPerformer"]))}</CurrentPerformer>' if defn.get('currentPerformer') else f'{i}<CurrentPerformer/>')
|
||||
X(f'{i}<Addressing>{esc_xml_text(str(defn["addressing"]))}</Addressing>' if defn.get('addressing') else f'{i}<Addressing/>')
|
||||
X(f'{i}<MainAddressingAttribute>{esc_xml_text(str(defn["mainAddressingAttribute"]))}</MainAddressingAttribute>' if defn.get('mainAddressingAttribute') else f'{i}<MainAddressingAttribute/>')
|
||||
X(f'{i}<CurrentPerformer>{esc_xml_text(str(defn["currentPerformer"]))}</CurrentPerformer>' if defn.get('currentPerformer') else f'{i}<CurrentPerformer/>')
|
||||
emit_based_on(i, defn.get('basedOn'))
|
||||
emit_standard_attributes(i, 'Task')
|
||||
emit_characteristics(i, defn.get('characteristics'))
|
||||
@@ -3727,11 +3727,11 @@ def emit_task_properties(indent):
|
||||
|
||||
def emit_http_service_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
X(f'{i}<Comment>{esc_xml(str(defn["comment"]))}</Comment>' if defn.get('comment') else f'{i}<Comment/>')
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>' if defn.get('comment') else f'{i}<Comment/>')
|
||||
root_url = str(defn['rootURL']) if defn.get('rootURL') else obj_name.lower()
|
||||
X(f'{i}<RootURL>{esc_xml(root_url)}</RootURL>')
|
||||
X(f'{i}<RootURL>{esc_xml_text(root_url)}</RootURL>')
|
||||
reuse_sessions = get_enum_prop('ReuseSessions', 'reuseSessions', 'DontUse')
|
||||
X(f'{i}<ReuseSessions>{reuse_sessions}</ReuseSessions>')
|
||||
session_max_age = str(defn['sessionMaxAge']) if defn.get('sessionMaxAge') is not None else '20'
|
||||
@@ -3744,16 +3744,16 @@ def emit_xdto_type(indent, tag, value):
|
||||
if m:
|
||||
X(f'{indent}<{tag} xmlns:d1p1="{esc_xml(m.group(1))}">d1p1:{esc_xml(m.group(2))}</{tag}>')
|
||||
else:
|
||||
X(f'{indent}<{tag}>{esc_xml(value)}</{tag}>')
|
||||
X(f'{indent}<{tag}>{esc_xml_text(value)}</{tag}>')
|
||||
|
||||
|
||||
def emit_web_service_properties(indent):
|
||||
i = indent
|
||||
X(f'{i}<Name>{esc_xml(obj_name)}</Name>')
|
||||
X(f'{i}<Name>{esc_xml_text(obj_name)}</Name>')
|
||||
emit_mltext(i, 'Synonym', synonym)
|
||||
X(f'{i}<Comment>{esc_xml(str(defn["comment"]))}</Comment>' if defn.get('comment') else f'{i}<Comment/>')
|
||||
X(f'{i}<Comment>{esc_xml_text(str(defn["comment"]))}</Comment>' if defn.get('comment') else f'{i}<Comment/>')
|
||||
namespace = str(defn['namespace']) if defn.get('namespace') else ''
|
||||
X(f'{i}<Namespace>{esc_xml(namespace)}</Namespace>')
|
||||
X(f'{i}<Namespace>{esc_xml_text(namespace)}</Namespace>')
|
||||
# XDTOPackages — СПИСОК элементов: ссылка на пакет конфигурации (xr:MDObjectRef) либо URI
|
||||
# внешнего пространства имён (xs:string). Presentation пуст, CheckState 0 (корпус: 19/19).
|
||||
pkgs = defn.get('xdtoPackages') or []
|
||||
@@ -3767,14 +3767,14 @@ def emit_web_service_properties(indent):
|
||||
X(f'{i}\t<xr:Item>')
|
||||
X(f'{i}\t\t<xr:Presentation/>')
|
||||
X(f'{i}\t\t<xr:CheckState>0</xr:CheckState>')
|
||||
X(f'{i}\t\t<xr:Value xsi:type="{xt}">{esc_xml(pv)}</xr:Value>')
|
||||
X(f'{i}\t\t<xr:Value xsi:type="{xt}">{esc_xml_text(pv)}</xr:Value>')
|
||||
X(f'{i}\t</xr:Item>')
|
||||
X(f'{i}</XDTOPackages>')
|
||||
else:
|
||||
X(f'{i}<XDTOPackages/>')
|
||||
# Имя файла дескриптора не выводится из имени сервиса (DMILService -> dmil.1cws) — только дефолт.
|
||||
descriptor = str(defn['descriptorFileName']) if defn.get('descriptorFileName') else f'{obj_name}.1cws'
|
||||
X(f'{i}<DescriptorFileName>{esc_xml(descriptor)}</DescriptorFileName>')
|
||||
X(f'{i}<DescriptorFileName>{esc_xml_text(descriptor)}</DescriptorFileName>')
|
||||
reuse_sessions = get_enum_prop('ReuseSessions', 'reuseSessions', 'DontUse')
|
||||
X(f'{i}<ReuseSessions>{reuse_sessions}</ReuseSessions>')
|
||||
session_max_age = str(defn['sessionMaxAge']) if defn.get('sessionMaxAge') is not None else '20'
|
||||
@@ -3804,7 +3804,7 @@ def emit_column(indent, col_def):
|
||||
references = list(col_def['references'])
|
||||
X(f'{indent}<Column uuid="{uid}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(name)}</Name>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml_text(name)}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', col_synonym)
|
||||
if comment:
|
||||
X(f'{indent}\t\t<Comment>{esc_xml_text(comment)}</Comment>')
|
||||
@@ -3814,7 +3814,7 @@ def emit_column(indent, col_def):
|
||||
if references:
|
||||
X(f'{indent}\t\t<References>')
|
||||
for ref in references:
|
||||
X(f'{indent}\t\t\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml(normalize_md_object_ref(str(ref)))}</xr:Item>')
|
||||
X(f'{indent}\t\t\t<xr:Item xsi:type="xr:MDObjectRef">{esc_xml_text(normalize_md_object_ref(str(ref)))}</xr:Item>')
|
||||
X(f'{indent}\t\t</References>')
|
||||
else:
|
||||
X(f'{indent}\t\t<References/>')
|
||||
@@ -3840,10 +3840,10 @@ def emit_url_template(indent, tmpl_name, tmpl_def):
|
||||
methods[k] = v # строка (HTTP-метод) ЛИБО объект {httpMethod, handler, synonym, comment}
|
||||
X(f'{indent}<URLTemplate uuid="{uid}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(tmpl_name)}</Name>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml_text(tmpl_name)}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', tmpl_synonym)
|
||||
X(f'{indent}\t\t<Comment>{esc_xml(tmpl_comment)}</Comment>' if tmpl_comment else f'{indent}\t\t<Comment/>')
|
||||
X(f'{indent}\t\t<Template>{esc_xml(template)}</Template>')
|
||||
X(f'{indent}\t\t<Comment>{esc_xml_text(tmpl_comment)}</Comment>' if tmpl_comment else f'{indent}\t\t<Comment/>')
|
||||
X(f'{indent}\t\t<Template>{esc_xml_text(template)}</Template>')
|
||||
X(f'{indent}\t</Properties>')
|
||||
if methods:
|
||||
X(f'{indent}\t<ChildObjects>')
|
||||
@@ -3865,11 +3865,11 @@ def emit_url_template(indent, tmpl_name, tmpl_def):
|
||||
method_comment = str(m_def.get('comment') or '')
|
||||
X(f'{indent}\t\t<Method uuid="{method_uuid}">')
|
||||
X(f'{indent}\t\t\t<Properties>')
|
||||
X(f'{indent}\t\t\t\t<Name>{esc_xml(method_name)}</Name>')
|
||||
X(f'{indent}\t\t\t\t<Name>{esc_xml_text(method_name)}</Name>')
|
||||
emit_mltext(f'{indent}\t\t\t\t', 'Synonym', method_synonym)
|
||||
X(f'{indent}\t\t\t\t<Comment>{esc_xml(method_comment)}</Comment>' if method_comment else f'{indent}\t\t\t\t<Comment/>')
|
||||
X(f'{indent}\t\t\t\t<Comment>{esc_xml_text(method_comment)}</Comment>' if method_comment else f'{indent}\t\t\t\t<Comment/>')
|
||||
X(f'{indent}\t\t\t\t<HTTPMethod>{http_method}</HTTPMethod>')
|
||||
X(f'{indent}\t\t\t\t<Handler>{esc_xml(handler)}</Handler>')
|
||||
X(f'{indent}\t\t\t\t<Handler>{esc_xml_text(handler)}</Handler>')
|
||||
X(f'{indent}\t\t\t</Properties>')
|
||||
X(f'{indent}\t\t</Method>')
|
||||
X(f'{indent}\t</ChildObjects>')
|
||||
@@ -3911,13 +3911,13 @@ def emit_operation(indent, op_name, op_def):
|
||||
params[k] = v
|
||||
X(f'{indent}<Operation uuid="{uid}">')
|
||||
X(f'{indent}\t<Properties>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml(op_name)}</Name>')
|
||||
X(f'{indent}\t\t<Name>{esc_xml_text(op_name)}</Name>')
|
||||
emit_mltext(f'{indent}\t\t', 'Synonym', op_synonym)
|
||||
X(f'{indent}\t\t<Comment>{esc_xml(op_comment)}</Comment>' if op_comment else f'{indent}\t\t<Comment/>')
|
||||
X(f'{indent}\t\t<Comment>{esc_xml_text(op_comment)}</Comment>' if op_comment else f'{indent}\t\t<Comment/>')
|
||||
emit_xdto_type(f'{indent}\t\t', 'XDTOReturningValueType', return_type)
|
||||
X(f'{indent}\t\t<Nillable>{nillable}</Nillable>')
|
||||
X(f'{indent}\t\t<Transactioned>{transactioned}</Transactioned>')
|
||||
X(f'{indent}\t\t<ProcedureName>{esc_xml(handler)}</ProcedureName>')
|
||||
X(f'{indent}\t\t<ProcedureName>{esc_xml_text(handler)}</ProcedureName>')
|
||||
X(f'{indent}\t\t<DataLockControlMode>{data_lock}</DataLockControlMode>')
|
||||
X(f'{indent}\t</Properties>')
|
||||
if params:
|
||||
@@ -3945,9 +3945,9 @@ def emit_operation(indent, op_name, op_def):
|
||||
param_comment = str(param_def['comment'])
|
||||
X(f'{indent}\t\t<Parameter uuid="{param_uuid}">')
|
||||
X(f'{indent}\t\t\t<Properties>')
|
||||
X(f'{indent}\t\t\t\t<Name>{esc_xml(param_name)}</Name>')
|
||||
X(f'{indent}\t\t\t\t<Name>{esc_xml_text(param_name)}</Name>')
|
||||
emit_mltext(f'{indent}\t\t\t\t', 'Synonym', param_synonym)
|
||||
X(f'{indent}\t\t\t\t<Comment>{esc_xml(param_comment)}</Comment>' if param_comment else f'{indent}\t\t\t\t<Comment/>')
|
||||
X(f'{indent}\t\t\t\t<Comment>{esc_xml_text(param_comment)}</Comment>' if param_comment else f'{indent}\t\t\t\t<Comment/>')
|
||||
emit_xdto_type(f'{indent}\t\t\t\t', 'XDTOValueType', param_type)
|
||||
X(f'{indent}\t\t\t\t<Nillable>{param_nillable}</Nillable>')
|
||||
X(f'{indent}\t\t\t\t<TransferDirection>{param_dir}</TransferDirection>')
|
||||
@@ -4755,7 +4755,7 @@ if obj_type == 'ExchangePlan':
|
||||
f'<ExchangePlanContent {xep_ns} version="{format_version}">\r\n']
|
||||
for it in c_items:
|
||||
parts.append('\t<Item>\r\n')
|
||||
parts.append(f'\t\t<Metadata>{esc_xml(it["metadata"])}</Metadata>\r\n')
|
||||
parts.append(f'\t\t<Metadata>{esc_xml_text(it["metadata"])}</Metadata>\r\n')
|
||||
parts.append(f'\t\t<AutoRecord>{it["autoRecord"]}</AutoRecord>\r\n')
|
||||
parts.append('\t</Item>\r\n')
|
||||
parts.append('</ExchangePlanContent>\r\n')
|
||||
@@ -4857,7 +4857,7 @@ if os.path.isfile(config_xml_path):
|
||||
reg_result = 'already'
|
||||
else:
|
||||
eol = '\r\n' if '\r\n' in config_content else '\n'
|
||||
entry = f'<{child_tag}>{esc_xml(obj_name)}</{child_tag}>'
|
||||
entry = f'<{child_tag}>{esc_xml_text(obj_name)}</{child_tag}>'
|
||||
|
||||
block = re.search(r'<ChildObjects\s*>.*?</ChildObjects>', config_content, re.S)
|
||||
if block is None:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# meta-decompile v0.61 — XML объекта метаданных 1С → JSON-черновик формата meta-compile
|
||||
# meta-decompile v0.62 — XML объекта метаданных 1С → JSON-черновик формата meta-compile
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
#
|
||||
# Поддержаны: Catalog, ExchangePlan, ChartOfCharacteristicTypes, ChartOfAccounts, ChartOfCalculationTypes, Document,
|
||||
@@ -1029,7 +1029,13 @@ if ($charsNode) {
|
||||
filterField = Shorten-CharField (& $gt 'TypesFilterField' $ct) $tFrom
|
||||
filterValue = if ($tfvNil -eq 'true') { $null } else { Convert-ChScalarNode $tfvNode }
|
||||
}
|
||||
$dpf = & $giv 'DataPathField' $ct; if ($dpf -ne -1) { $types['dataPathField'] = $dpf }
|
||||
# DataPathField полиморфно: обычно -1, но встречается ПУТЬ к полю (8 случаев на корпус).
|
||||
# Жёсткое [int] на нём роняло декомпиляцию всего объекта.
|
||||
$dpfN = $ct.SelectSingleNode('xr:DataPathField', $nsm)
|
||||
$dpfT = if ($dpfN) { $dpfN.InnerText } else { '' }
|
||||
if ($dpfT -ne '' -and $dpfT -cne '-1') {
|
||||
$types['dataPathField'] = if ($dpfT -match '^-?\d+$') { [int]$dpfT } else { Shorten-CharField $dpfT $tFrom }
|
||||
}
|
||||
$mvu = & $giv 'MultipleValuesUseField' $ct; if ($mvu -ne -1) { $types['multipleValuesUseField'] = $mvu }
|
||||
$values = [ordered]@{
|
||||
from = $vFrom
|
||||
|
||||
Reference in New Issue
Block a user