Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
seda
Commits
e8f14e28f4e0
Commit
73b3d4a9
authored
Dec 14, 2016
by
Sylvain Thénault
Browse files
[profile gen] DescriptionLevel should be before Name in SEDA 0.2
parent
3436855cb5a6
Changes
3
Hide whitespace changes
Inline
Side-by-side
entities/profile_generation.py
View file @
e8f14e28
...
...
@@ -1174,14 +1174,14 @@ class SEDA02XSDExport(SEDA1XSDExport):
self
.
element_schema
(
archive_node
,
'DescriptionLanguage'
,
'qdt:CodeLanguageType'
,
fixed_value
=
'fr'
,
xsd_attributes
=
[
LIST_VERSION_ID_2009
])
# in SEDA 0.2, description level is on the archive element, not on its content description
content_entity
=
self
.
archive_unit_content
(
archive_unit
)
self
.
xsd_description_level
(
archive_node
,
content_entity
.
description_level_concept
)
name_entity
=
self
.
archive_unit_name
(
archive_unit
)
self
.
element_schema
(
archive_node
,
'Name'
,
'udt:TextType'
,
fixed_value
=
name_entity
.
title
,
documentation
=
name_entity
.
user_annotation
,
xsd_attributes
=
[
XAttr
(
'languageID'
,
'xsd:language'
)])
# in SEDA 0.2, description level is on the archive element, not on its content description
content_entity
=
self
.
archive_unit_content
(
archive_unit
)
self
.
xsd_description_level
(
archive_node
,
content_entity
.
description_level_concept
)
appraisal_rule_entity
=
self
.
archive_unit_appraisal_rule
(
archive_unit
)
if
appraisal_rule_entity
:
self
.
xsd_appraisal_rule
(
archive_node
,
appraisal_rule_entity
)
...
...
@@ -1225,6 +1225,9 @@ class SEDA02XSDExport(SEDA1XSDExport):
# description
content_entity
=
self
.
archive_unit_content
(
archive_unit
)
self
.
xsd_description_level
(
ao_node
,
content_entity
.
description_level_concept
)
# actually DescriptionLevel should be before Name (ie. currently the last and first
# elements)
ao_node
.
insert
(
0
,
ao_node
[
-
1
])
# in SEDA 0.2, ArchiveObject tag name is 'Contains' (as for Archive)
archive_object_tag_name
=
'Contains'
...
...
test/data/seda_02_export.rng
View file @
e8f14e28
...
...
@@ -42,14 +42,14 @@
</rng:attribute>
<rng:value
type=
"string"
>
fr
</rng:value>
</rng:element>
<rng:element
name=
"Name"
>
<rng:data
type=
"string"
/>
</rng:element>
<rng:element
name=
"DescriptionLevel"
>
<rng:attribute
name=
"listVersionID"
>
<rng:value
type=
"token"
>
edition 2009
</rng:value>
</rng:attribute>
<rng:value
type=
"string"
>
file
</rng:value>
</rng:element>
<rng:element
name=
"Name"
>
<rng:data
type=
"string"
/>
</rng:element>
<rng:optional>
<rng:element
name=
"Appraisal"
>
...
...
@@ -125,6 +125,12 @@
</rng:element>
<rng:oneOrMore>
<rng:element
name=
"Contains"
>
<rng:element
name=
"DescriptionLevel"
>
<rng:attribute
name=
"listVersionID"
>
<rng:value
type=
"token"
>
edition 2009
</rng:value>
</rng:attribute>
<rng:data
type=
"string"
/>
</rng:element>
<rng:element
name=
"Name"
>
<rng:data
type=
"string"
/>
</rng:element>
...
...
@@ -158,16 +164,16 @@
<rng:data
type=
"string"
/>
</rng:element>
</rng:element>
</rng:element>
</rng:oneOrMore>
<rng:oneOrMore>
<rng:element
name=
"Contains"
>
<rng:element
name=
"DescriptionLevel"
>
<rng:attribute
name=
"listVersionID"
>
<rng:value
type=
"token"
>
edition 2009
</rng:value>
</rng:attribute>
<rng:data
type=
"string"
/>
</rng:element>
</rng:element>
</rng:oneOrMore>
<rng:oneOrMore>
<rng:element
name=
"Contains"
>
<rng:element
name=
"Name"
>
<rng:data
type=
"string"
/>
</rng:element>
...
...
@@ -204,12 +210,6 @@
<rng:data
type=
"string"
/>
</rng:element>
</rng:element>
<rng:element
name=
"DescriptionLevel"
>
<rng:attribute
name=
"listVersionID"
>
<rng:value
type=
"token"
>
edition 2009
</rng:value>
</rng:attribute>
<rng:data
type=
"string"
/>
</rng:element>
</rng:element>
</rng:oneOrMore>
<rng:zeroOrMore>
...
...
test/data/seda_02_export.xsd
View file @
e8f14e28
...
...
@@ -84,20 +84,20 @@
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"Name
"
>
<xsd:element
fixed=
"file"
name=
"DescriptionLevel
"
>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension
base=
"
u
dt:
Text
Type"
>
<xsd:attribute
name=
"languageID"
type=
"xsd:language"
use=
"prohibit
ed"
/>
<xsd:extension
base=
"
q
dt:
CodeDescriptionLevel
Type"
>
<xsd:attribute
fixed=
"edition 2009"
name=
"listVersionID"
type=
"xsd:token"
use=
"requir
ed"
/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element
fixed=
"file"
name=
"DescriptionLevel
"
>
<xsd:element
name=
"Name
"
>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension
base=
"
q
dt:
CodeDescriptionLevel
Type"
>
<xsd:attribute
fixed=
"edition 2009"
name=
"listVersionID"
type=
"xsd:token"
use=
"requir
ed"
/>
<xsd:extension
base=
"
u
dt:
Text
Type"
>
<xsd:attribute
name=
"languageID"
type=
"xsd:language"
use=
"prohibit
ed"
/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
...
...
@@ -204,6 +204,15 @@
<xsd:element
maxOccurs=
"unbounded"
name=
"Contains"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"DescriptionLevel"
>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension
base=
"qdt:CodeDescriptionLevelType"
>
<xsd:attribute
fixed=
"edition 2009"
name=
"listVersionID"
type=
"xsd:token"
use=
"required"
/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"Name"
>
<xsd:complexType>
<xsd:simpleContent>
...
...
@@ -251,6 +260,13 @@
<xsd:attribute
name=
"Id"
type=
"xsd:ID"
use=
"prohibited"
/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute
name=
"Id"
type=
"xsd:ID"
use=
"prohibited"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
maxOccurs=
"unbounded"
name=
"Contains"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"DescriptionLevel"
>
<xsd:complexType>
<xsd:simpleContent>
...
...
@@ -260,13 +276,6 @@
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute
name=
"Id"
type=
"xsd:ID"
use=
"prohibited"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
maxOccurs=
"unbounded"
name=
"Contains"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"Name"
>
<xsd:complexType>
<xsd:simpleContent>
...
...
@@ -318,15 +327,6 @@
<xsd:attribute
name=
"Id"
type=
"xsd:ID"
use=
"prohibited"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"DescriptionLevel"
>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension
base=
"qdt:CodeDescriptionLevelType"
>
<xsd:attribute
fixed=
"edition 2009"
name=
"listVersionID"
type=
"xsd:token"
use=
"required"
/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute
name=
"Id"
type=
"xsd:ID"
use=
"prohibited"
/>
</xsd:complexType>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment