[PATCH 2 of 2 saem_ref] [seda] Plug activities onto archive transfer

Sylvain Thénault sylvain.thenault at logilab.fr
Fri Mar 10 17:21:45 CET 2017


V2 sent


Le 10/03/2017 à 15:01, Denis Laxalde a écrit :
> Sylvain Thenault a écrit :
>> # HG changeset patch
>> # User Sylvain Thénault <sylvain.thenault at logilab.fr>
>> # Date 1489081332 -3600
>> #      Thu Mar 09 18:42:12 2017 +0100
>> # Node ID b12609d7988af407b34b2edb556ec579aada6afb
>> # Parent  bbb85a687dffa6c99b6ee12b554ab624bf57d2c1
>> [seda] Plug activities onto archive transfer
>>
>> Related to extranet #3101354
>>
>> diff --git a/cubicweb_saem_ref/entities/container.py
>> b/cubicweb_saem_ref/entities/container.py
>> --- a/cubicweb_saem_ref/entities/container.py
>> +++ b/cubicweb_saem_ref/entities/container.py
>> @@ -38,21 +38,30 @@ def concept_container_def(schema):
>>      """Define container for Concept"""
>>      return structure_def(schema, 'Concept').items()
>>
>>
>>  def registration_callback(vreg):
>> +    # don't define IContained class for Activity, because it cause
>> problem since it belongs to
>> +    # both SEDAArchiveTransfer tree and to concept/authority record
>> tree, which don't have the
>> +    # same IContained implementation. Since we do not actually need
>> this adapter on Activity,
>> +    # simply skip it.
>> +    def skip_activity(container_def_iterator):
>> +        for etype, parent_relations in container_def_iterator:
>> +            if etype != 'Activity':
>> +                yield etype, parent_relations
>> +
>
> Can't we put "Activity" into skipetypes list in structure_def call?
>
>>      vreg.register(IContainer.build_class('Organization'))
>>      for etype, parent_relations in org_container_def(vreg.schema):
>>          IContained.register_class(vreg, etype, parent_relations)
>>      vreg.register(IContainer.build_class('AuthorityRecord'))
>> -    for etype, parent_relations in
>> authority_record_container_def(vreg.schema):
>> +    for etype, parent_relations in
>> skip_activity(authority_record_container_def(vreg.schema)):
>>          IContained.register_class(vreg, etype, parent_relations)
>>      vreg.register(IContainer.build_class('ConceptScheme'))
>> -    for etype, parent_relations in scheme_container_def(vreg.schema):
>> +    for etype, parent_relations in
>> skip_activity(scheme_container_def(vreg.schema)):
>>          if etype == 'Concept':
>>              # XXX turn parent_relations to a list to ensure
>> broader_concept is considered first
>>              parent_relations = list(parent_relations)
>>              parent_relations.insert(0, ('broader_concept', 'subject'))
>>          IContained.register_class(vreg, etype, parent_relations)
>>      vreg.register(IContainer.build_class('Concept'))
>> -    for etype, parent_relations in concept_container_def(vreg.schema):
>> +    for etype, parent_relations in
>> skip_activity(concept_container_def(vreg.schema)):
>>          IContained.register_class(vreg, etype, parent_relations)
>> diff --git a/cubicweb_saem_ref/i18n/en.po b/cubicweb_saem_ref/i18n/en.po
>> --- a/cubicweb_saem_ref/i18n/en.po
>> +++ b/cubicweb_saem_ref/i18n/en.po
>> @@ -519,10 +519,14 @@ msgstr "contact point of"
>>
>>  msgctxt "Agent"
>>  msgid "contact_point_object"
>>  msgstr ""
>>
>> +msgctxt "Activity"
>> +msgid "container"
>> +msgstr ""
>> +
>
> I don't get were this message comes from?
>
>>  msgid "control"
>>  msgstr "control service"
>>
>>  msgid "created"
>>  msgstr ""
>> @@ -729,16 +733,15 @@ msgstr ""
>>
>>  msgctxt "ConceptScheme"
>>  msgid "generated_object"
>>  msgstr ""
>>
>> -msgid "latest update on"
>> +msgctxt "SEDAArchiveTransfer"
>> +msgid "generated_object"
>>  msgstr ""
>>
>> -msgid ""
>> -"let this unspecified to see the definition of the related concept
>> if a "
>> -"vocabulary is specifed"
>> +msgid "latest update on"
>>  msgstr ""
>
> unrelated?
>

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org



More information about the saem-devel mailing list