talk@lists.collectionspace.org

WE HAVE SUNSET THIS LISTSERV - Join us at collectionspace@lyrasislists.org

View all threads

Add a field in an existing <repeat> (using xmlmerge)

SB
Sébastien Brossard
Fri, Aug 10, 2012 2:59 PM

Hi all,

I've been trying adding our StructuredSMKDate field to the existing textualInscriptionGroupList/textualInscriptionGroup, which is declared as a <repeat> group.
The service is declared as follow and works well (REST test) :

<xs:element name="textualInscriptionGroupList">
xs:complexType
xs:sequence
<xs:element name="textualInscriptionGroup">
<xs:complexType >
xs:sequence
<xs:element name="inscriptionContentSMKDateGroup" type="structuredDateSMKGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:complexType name="structuredDateSMKGroup">
xs:sequence
<xs:element name="dateSMKDisplayText" type="xs:string"/>
<xs:element name="dateSMKDateDay" type="xs:string"/>
<xs:element name="dateSMKDateMonth" type="xs:string"/>
<xs:element name="dateSMKDateYear" type="xs:string"/>
<xs:element name="dateSMKEraSelector" type="xs:string"/>
<xs:element name="dateSMKSecondDateDay" type="xs:string"/>
<xs:element name="dateSMKSecondDateMonth" type="xs:string"/>
<xs:element name="dateSMKSecondDateYear" type="xs:string"/>
<xs:element name="dateSMKSecondEraSelector" type="xs:string"/>
<xs:element name="dateSMKThirdDateDay" type="xs:string"/>
<xs:element name="dateSMKThirdDateMonth" type="xs:string"/>
<xs:element name="dateSMKThirdDateYear" type="xs:string"/>
<xs:element name="dateSMKThirdEraSelector" type="xs:string"/>
<xs:element name="dateSMKSegmentSelector" type="xs:string"/>
<xs:element name="dateSMKTypeSelector" type="xs:string"/>
<xs:element name="scalarValuesComputed" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>

In the application, I created the following smk-textual-collectionobject.xml file in my tenant:

<record id="collection-object"> <services-record-path id="smk">collectionobjects_smk:http://collectionspace.org/services/collectionobject/local/smk,collectionobjects_smk</services-record-path> <section id="textualInscriptionInformation"> <repeat id="textualInscriptionGroupList/textualInscriptionGroup"> <group id="textualSMKDateGroup" ui-type="groupfield/structureddateSMK" primarykey="dateSMKDisplayText" ui-func="cspace.structuredDateSMK">
                                        <services-tag>textualInscriptionGroupList/textualInscriptionGroup</services-tag>
                                        <selector>object-description-inscription-content-date-smk</selector>

                  <field id="dateSMKDisplayText" section="smk"/>
                                        <field id="dateSMKDateDay" section="smk"/>
                                        <field id="dateSMKDateMonth" section="smk"/>                                                                                                                                                                  <field id="dateSMKDateYear" section="smk"/>
                                        <field id="dateSMKEraSelector" section="smk"/>
                                        <field id="dateSMKSecondDateDay" section="smk"/>
                                        <field id="dateSMKSecondDateMonth" section="smk"/>
                                        <field id="dateSMKSecondDateYear" section="smk"/>
                                        <field id="dateSMKSecondEraSelector" section="smk"/>
                                        <field id="dateSMKThirdDateDay" section="smk"/>
                                        <field id="dateSMKThirdDateMonth" section="smk"/>                                                                                                                                                          <field id="dateSMKThirdDateYear" section="smk"/>
                                        <field id="dateSMKThirdEraSelector" section="smk"/>
                                        <field id="dateSMKSegmentSelector" section="smk"/>
                                        <field id="dateSMKTypeSelector" section="smk"/>
                                        <field id="scalarValuesComputed" ui-search="false" section="smk"/>

                         </group>
     </repeat>
</section> </record>

This file is declared in smk-tenant.xml:
<include src="base-collectionobject.xml,smk-textual-collectionobject.xml" merge="xmlmerge.properties"/>)

The object-description-inscription-content-date-smk  inserted in the UI.

But the problem is the following: in the SMK's Cataloging page, it's not anymore the whole Textual Inscription group that is repeatable, but just the (customized) date field.

After numerous tries without success, I've tried the overlay method (mail to follow...)

Sébastien Brossard
IT-Udvikler
sebastien.brossard@smk.dkmailto:3sebastien.brossard@smk.dkT
Tmailto:3sebastien.brossard@smk.dkT +45 3374 8483

Statens Museum for Kunst
Sølvgade 48-50
DK-1307 København K

T +45 3374 8494
F +45 3374 8404
smk.dkhttp://smk.dk/

[Beskrivelse: Logo_mail]

Hi all, I've been trying adding our StructuredSMKDate field to the existing textualInscriptionGroupList/textualInscriptionGroup, which is declared as a <repeat> group. The service is declared as follow and works well (REST test) : <xs:element name="textualInscriptionGroupList"> <xs:complexType> <xs:sequence> <xs:element name="textualInscriptionGroup"> <xs:complexType > <xs:sequence> <xs:element name="inscriptionContentSMKDateGroup" type="structuredDateSMKGroup"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="structuredDateSMKGroup"> <xs:sequence> <xs:element name="dateSMKDisplayText" type="xs:string"/> <xs:element name="dateSMKDateDay" type="xs:string"/> <xs:element name="dateSMKDateMonth" type="xs:string"/> <xs:element name="dateSMKDateYear" type="xs:string"/> <xs:element name="dateSMKEraSelector" type="xs:string"/> <xs:element name="dateSMKSecondDateDay" type="xs:string"/> <xs:element name="dateSMKSecondDateMonth" type="xs:string"/> <xs:element name="dateSMKSecondDateYear" type="xs:string"/> <xs:element name="dateSMKSecondEraSelector" type="xs:string"/> <xs:element name="dateSMKThirdDateDay" type="xs:string"/> <xs:element name="dateSMKThirdDateMonth" type="xs:string"/> <xs:element name="dateSMKThirdDateYear" type="xs:string"/> <xs:element name="dateSMKThirdEraSelector" type="xs:string"/> <xs:element name="dateSMKSegmentSelector" type="xs:string"/> <xs:element name="dateSMKTypeSelector" type="xs:string"/> <xs:element name="scalarValuesComputed" type="xs:boolean"/> </xs:sequence> </xs:complexType> In the application, I created the following smk-textual-collectionobject.xml file in my tenant: <record id="collection-object"> <services-record-path id="smk">collectionobjects_smk:http://collectionspace.org/services/collectionobject/local/smk,collectionobjects_smk</services-record-path> <section id="textualInscriptionInformation"> <repeat id="textualInscriptionGroupList/textualInscriptionGroup"> <group id="textualSMKDateGroup" ui-type="groupfield/structureddateSMK" primarykey="dateSMKDisplayText" ui-func="cspace.structuredDateSMK"> <services-tag>textualInscriptionGroupList/textualInscriptionGroup</services-tag> <selector>object-description-inscription-content-date-smk</selector> <field id="dateSMKDisplayText" section="smk"/> <field id="dateSMKDateDay" section="smk"/> <field id="dateSMKDateMonth" section="smk"/> <field id="dateSMKDateYear" section="smk"/> <field id="dateSMKEraSelector" section="smk"/> <field id="dateSMKSecondDateDay" section="smk"/> <field id="dateSMKSecondDateMonth" section="smk"/> <field id="dateSMKSecondDateYear" section="smk"/> <field id="dateSMKSecondEraSelector" section="smk"/> <field id="dateSMKThirdDateDay" section="smk"/> <field id="dateSMKThirdDateMonth" section="smk"/> <field id="dateSMKThirdDateYear" section="smk"/> <field id="dateSMKThirdEraSelector" section="smk"/> <field id="dateSMKSegmentSelector" section="smk"/> <field id="dateSMKTypeSelector" section="smk"/> <field id="scalarValuesComputed" ui-search="false" section="smk"/> </group> </repeat> </section> </record> This file is declared in smk-tenant.xml: <include src="base-collectionobject.xml,smk-textual-collectionobject.xml" merge="xmlmerge.properties"/>) The object-description-inscription-content-date-smk inserted in the UI. But the problem is the following: in the SMK's Cataloging page, it's not anymore the whole Textual Inscription group that is repeatable, but just the (customized) date field. After numerous tries without success, I've tried the overlay method (mail to follow...) Sébastien Brossard IT-Udvikler sebastien.brossard@smk.dk<mailto:3sebastien.brossard@smk.dkT> T<mailto:3sebastien.brossard@smk.dkT> +45 3374 8483 Statens Museum for Kunst Sølvgade 48-50 DK-1307 København K T +45 3374 8494 F +45 3374 8404 smk.dk<http://smk.dk/> [Beskrivelse: Logo_mail]
RL
Ray Lee
Thu, Aug 16, 2012 12:30 AM

Hi Sébastien,
The problem, unfortunately, is that you can't inject a field from the smk schema into a complex type from the common schema. You need to recreate the group and all of the fields within it, in the smk schema. There's also the problem that the app layer gets confused if fields/groups in your schema have the same name as fields in the common schema, so everything has to have a different name. In the services layer, the smk schema might look something like this:

<xs:element name="smkTextualInscriptionGroupList" type="smkTextualInscriptionGroupList"/>
<xs:complexType name="smkTextualInscriptionGroupList">
    <xs:sequence>
        <xs:element name="smkTextualInscriptionGroup" type="smkTextualInscriptionGroup" minOccurs="0"
            maxOccurs="unbounded"/>
    </xs:sequence>
</xs:complexType>

<xs:complexType name="smkTextualInscriptionGroup">
    <xs:sequence>
        <xs:element name="smkInscriptionContent" type="xs:string"/>
        <xs:element name="smkInscriptionContentInscriber" type="xs:string"/>
        <xs:element name="smkInscriptionContentDateGroup" type="structuredDateSMKGroup"/>
        <xs:element name="smkInscriptionContentInterpretation" type="xs:string"/>
        <xs:element name="smkInscriptionContentLanguage" type="xs:string"/>
        <xs:element name="smkInscriptionContentMethod" type="xs:string"/>
        <xs:element name="smkInscriptionContentPosition" type="xs:string"/>
        <xs:element name="smkInscriptionContentScript" type="xs:string"/>
        <xs:element name="smkInscriptionContentTranslation" type="xs:string"/>
        <xs:element name="smkInscriptionContentTransliteration" type="xs:string"/>
        <xs:element name="smkInscriptionContentType" type="xs:string"/>
    </xs:sequence>
</xs:complexType>

Then, in the app layer config, whether you do it using the merge or overlay method, you would define this new group and fields (making sure you use section="smk" on the repeat tag, as well as on the field tags). In the UI, you would hide or remove the existing fields, but recreate them with the proper selectors for the new smk fields. It's not pretty, but it should work.

Ray

On Aug 10, 2012, at 7:59 AM, Sébastien Brossard wrote:

Hi all,

I’ve been trying adding our StructuredSMKDate field to the existing textualInscriptionGroupList/textualInscriptionGroup, which is declared as a <repeat> group.
The service is declared as follow and works well (REST test) :

<xs:element name="textualInscriptionGroupList">
xs:complexType
xs:sequence
<xs:element name="textualInscriptionGroup">
<xs:complexType >
xs:sequence
<xs:element name="inscriptionContentSMKDateGroup" type="structuredDateSMKGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:complexType name="structuredDateSMKGroup">
xs:sequence
<xs:element name="dateSMKDisplayText" type="xs:string"/>
<xs:element name="dateSMKDateDay" type="xs:string"/>
<xs:element name="dateSMKDateMonth" type="xs:string"/>
<xs:element name="dateSMKDateYear" type="xs:string"/>
<xs:element name="dateSMKEraSelector" type="xs:string"/>
<xs:element name="dateSMKSecondDateDay" type="xs:string"/>
<xs:element name="dateSMKSecondDateMonth" type="xs:string"/>
<xs:element name="dateSMKSecondDateYear" type="xs:string"/>
<xs:element name="dateSMKSecondEraSelector" type="xs:string"/>
<xs:element name="dateSMKThirdDateDay" type="xs:string"/>
<xs:element name="dateSMKThirdDateMonth" type="xs:string"/>
<xs:element name="dateSMKThirdDateYear" type="xs:string"/>
<xs:element name="dateSMKThirdEraSelector" type="xs:string"/>
<xs:element name="dateSMKSegmentSelector" type="xs:string"/>
<xs:element name="dateSMKTypeSelector" type="xs:string"/>
<xs:element name="scalarValuesComputed" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>

In the application, I created the following smk-textual-collectionobject.xml file in my tenant:

<record id="collection-object"> <services-record-path id="smk">collectionobjects_smk:http://collectionspace.org/services/collectionobject/local/smk,collectionobjects_smk</services-record-path> <section id="textualInscriptionInformation"> <repeat id="textualInscriptionGroupList/textualInscriptionGroup"> <group id="textualSMKDateGroup" ui-type="groupfield/structureddateSMK" primarykey="dateSMKDisplayText" ui-func="cspace.structuredDateSMK">
                                         <services-tag>textualInscriptionGroupList/textualInscriptionGroup</services-tag>
                                         <selector>object-description-inscription-content-date-smk</selector>                                                                                           
                                                 
                   <field id="dateSMKDisplayText" section="smk"/>                                           
                                         <field id="dateSMKDateDay" section="smk"/>                  
                                         <field id="dateSMKDateMonth" section="smk"/>                                                                                                                                                                  <field id="dateSMKDateYear" section="smk"/>                   
                                         <field id="dateSMKEraSelector" section="smk"/>                                       
                                         <field id="dateSMKSecondDateDay" section="smk"/>                   
                                         <field id="dateSMKSecondDateMonth" section="smk"/>                                                                                   
                                         <field id="dateSMKSecondDateYear" section="smk"/>                   
                                         <field id="dateSMKSecondEraSelector" section="smk"/>                                        
                                         <field id="dateSMKThirdDateDay" section="smk"/>                   
                                         <field id="dateSMKThirdDateMonth" section="smk"/>                                                                                                                                                          <field id="dateSMKThirdDateYear" section="smk"/>                   
                                         <field id="dateSMKThirdEraSelector" section="smk"/>                                       
                                         <field id="dateSMKSegmentSelector" section="smk"/>                                       
                                         <field id="dateSMKTypeSelector" section="smk"/>                   
                                         <field id="scalarValuesComputed" ui-search="false" section="smk"/>  
                                                                                                
                          </group>                                                   
      </repeat>                                                                                         
</section>
</record>

This file is declared in smk-tenant.xml:
<include src="base-collectionobject.xml,smk-textual-collectionobject.xml" merge="xmlmerge.properties"/>)

The object-description-inscription-content-date-smk  inserted in the UI.

But the problem is the following: in the SMK’s Cataloging page, it’s not anymore the whole Textual Inscription group that is repeatable, but just the (customized) date field.

After numerous tries without success, I’ve tried the overlay method (mail to follow…)

Sébastien Brossard
IT-Udvikler
sebastien.brossard@smk.dk
T +45 3374 8483

Statens Museum for Kunst
Sølvgade 48-50
DK—1307 København K
T +45 3374 8494
F +45 3374 8404
smk.dk

<image003.jpg>


Talk mailing list
Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org

Hi Sébastien, The problem, unfortunately, is that you can't inject a field from the smk schema into a complex type from the common schema. You need to recreate the group and all of the fields within it, in the smk schema. There's also the problem that the app layer gets confused if fields/groups in your schema have the same name as fields in the common schema, so everything has to have a different name. In the services layer, the smk schema might look something like this: <xs:element name="smkTextualInscriptionGroupList" type="smkTextualInscriptionGroupList"/> <xs:complexType name="smkTextualInscriptionGroupList"> <xs:sequence> <xs:element name="smkTextualInscriptionGroup" type="smkTextualInscriptionGroup" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="smkTextualInscriptionGroup"> <xs:sequence> <xs:element name="smkInscriptionContent" type="xs:string"/> <xs:element name="smkInscriptionContentInscriber" type="xs:string"/> <xs:element name="smkInscriptionContentDateGroup" type="structuredDateSMKGroup"/> <xs:element name="smkInscriptionContentInterpretation" type="xs:string"/> <xs:element name="smkInscriptionContentLanguage" type="xs:string"/> <xs:element name="smkInscriptionContentMethod" type="xs:string"/> <xs:element name="smkInscriptionContentPosition" type="xs:string"/> <xs:element name="smkInscriptionContentScript" type="xs:string"/> <xs:element name="smkInscriptionContentTranslation" type="xs:string"/> <xs:element name="smkInscriptionContentTransliteration" type="xs:string"/> <xs:element name="smkInscriptionContentType" type="xs:string"/> </xs:sequence> </xs:complexType> Then, in the app layer config, whether you do it using the merge or overlay method, you would define this new group and fields (making sure you use section="smk" on the repeat tag, as well as on the field tags). In the UI, you would hide or remove the existing fields, but recreate them with the proper selectors for the new smk fields. It's not pretty, but it should work. Ray On Aug 10, 2012, at 7:59 AM, Sébastien Brossard wrote: > Hi all, > > I’ve been trying adding our StructuredSMKDate field to the existing textualInscriptionGroupList/textualInscriptionGroup, which is declared as a <repeat> group. > The service is declared as follow and works well (REST test) : > > <xs:element name="textualInscriptionGroupList"> > <xs:complexType> > <xs:sequence> > <xs:element name="textualInscriptionGroup"> > <xs:complexType > > <xs:sequence> > <xs:element name="inscriptionContentSMKDateGroup" type="structuredDateSMKGroup"/> > </xs:sequence> > </xs:complexType> > </xs:element> > </xs:sequence> > </xs:complexType> > </xs:element> > > <xs:complexType name="structuredDateSMKGroup"> > <xs:sequence> > <xs:element name="dateSMKDisplayText" type="xs:string"/> > <xs:element name="dateSMKDateDay" type="xs:string"/> > <xs:element name="dateSMKDateMonth" type="xs:string"/> > <xs:element name="dateSMKDateYear" type="xs:string"/> > <xs:element name="dateSMKEraSelector" type="xs:string"/> > <xs:element name="dateSMKSecondDateDay" type="xs:string"/> > <xs:element name="dateSMKSecondDateMonth" type="xs:string"/> > <xs:element name="dateSMKSecondDateYear" type="xs:string"/> > <xs:element name="dateSMKSecondEraSelector" type="xs:string"/> > <xs:element name="dateSMKThirdDateDay" type="xs:string"/> > <xs:element name="dateSMKThirdDateMonth" type="xs:string"/> > <xs:element name="dateSMKThirdDateYear" type="xs:string"/> > <xs:element name="dateSMKThirdEraSelector" type="xs:string"/> > <xs:element name="dateSMKSegmentSelector" type="xs:string"/> > <xs:element name="dateSMKTypeSelector" type="xs:string"/> > <xs:element name="scalarValuesComputed" type="xs:boolean"/> > </xs:sequence> > </xs:complexType> > > > In the application, I created the following smk-textual-collectionobject.xml file in my tenant: > > <record id="collection-object"> > <services-record-path id="smk">collectionobjects_smk:http://collectionspace.org/services/collectionobject/local/smk,collectionobjects_smk</services-record-path> > > <section id="textualInscriptionInformation"> > <repeat id="textualInscriptionGroupList/textualInscriptionGroup"> > <group id="textualSMKDateGroup" ui-type="groupfield/structureddateSMK" primarykey="dateSMKDisplayText" > ui-func="cspace.structuredDateSMK"> > > <services-tag>textualInscriptionGroupList/textualInscriptionGroup</services-tag> > <selector>object-description-inscription-content-date-smk</selector> > > <field id="dateSMKDisplayText" section="smk"/> > <field id="dateSMKDateDay" section="smk"/> > <field id="dateSMKDateMonth" section="smk"/> <field id="dateSMKDateYear" section="smk"/> > <field id="dateSMKEraSelector" section="smk"/> > <field id="dateSMKSecondDateDay" section="smk"/> > <field id="dateSMKSecondDateMonth" section="smk"/> > <field id="dateSMKSecondDateYear" section="smk"/> > <field id="dateSMKSecondEraSelector" section="smk"/> > <field id="dateSMKThirdDateDay" section="smk"/> > <field id="dateSMKThirdDateMonth" section="smk"/> <field id="dateSMKThirdDateYear" section="smk"/> > <field id="dateSMKThirdEraSelector" section="smk"/> > <field id="dateSMKSegmentSelector" section="smk"/> > <field id="dateSMKTypeSelector" section="smk"/> > <field id="scalarValuesComputed" ui-search="false" section="smk"/> > > </group> > </repeat> > </section> > </record> > > This file is declared in smk-tenant.xml: > <include src="base-collectionobject.xml,smk-textual-collectionobject.xml" merge="xmlmerge.properties"/>) > > The object-description-inscription-content-date-smk inserted in the UI. > > But the problem is the following: in the SMK’s Cataloging page, it’s not anymore the whole Textual Inscription group that is repeatable, but just the (customized) date field. > > After numerous tries without success, I’ve tried the overlay method (mail to follow…) > > > Sébastien Brossard > IT-Udvikler > sebastien.brossard@smk.dk > T +45 3374 8483 > > Statens Museum for Kunst > Sølvgade 48-50 > DK—1307 København K > T +45 3374 8494 > F +45 3374 8404 > smk.dk > > <image003.jpg> > > > _______________________________________________ > Talk mailing list > Talk@lists.collectionspace.org > http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org
SB
Sébastien Brossard
Tue, Aug 21, 2012 12:27 PM

Hi Ray,

Thank you for your answer - as you said, it's a work-around, but it works nevertheless.

Best regards,
Sébastien

Fra: Ray Lee [mailto:rhlee@berkeley.edu]
Sendt: 16. august 2012 02:31
Til: Sébastien Brossard
Cc: talk@lists.collectionspace.org List
Emne: Re: [Talk] Add a field in an existing <repeat> (using xmlmerge)

Hi Sébastien,
The problem, unfortunately, is that you can't inject a field from the smk schema into a complex type from the common schema. You need to recreate the group and all of the fields within it, in the smk schema. There's also the problem that the app layer gets confused if fields/groups in your schema have the same name as fields in the common schema, so everything has to have a different name. In the services layer, the smk schema might look something like this:

<xs:element name="smkTextualInscriptionGroupList" type="smkTextualInscriptionGroupList"/>
<xs:complexType name="smkTextualInscriptionGroupList">
    <xs:sequence>
        <xs:element name="smkTextualInscriptionGroup" type="smkTextualInscriptionGroup" minOccurs="0"
            maxOccurs="unbounded"/>
    </xs:sequence>
</xs:complexType>

<xs:complexType name="smkTextualInscriptionGroup">
    <xs:sequence>
        <xs:element name="smkInscriptionContent" type="xs:string"/>
        <xs:element name="smkInscriptionContentInscriber" type="xs:string"/>
        <xs:element name="smkInscriptionContentDateGroup" type="structuredDateSMKGroup"/>
        <xs:element name="smkInscriptionContentInterpretation" type="xs:string"/>
        <xs:element name="smkInscriptionContentLanguage" type="xs:string"/>
        <xs:element name="smkInscriptionContentMethod" type="xs:string"/>
        <xs:element name="smkInscriptionContentPosition" type="xs:string"/>
        <xs:element name="smkInscriptionContentScript" type="xs:string"/>
        <xs:element name="smkInscriptionContentTranslation" type="xs:string"/>
        <xs:element name="smkInscriptionContentTransliteration" type="xs:string"/>
        <xs:element name="smkInscriptionContentType" type="xs:string"/>
    </xs:sequence>
</xs:complexType>

Then, in the app layer config, whether you do it using the merge or overlay method, you would define this new group and fields (making sure you use section="smk" on the repeat tag, as well as on the field tags). In the UI, you would hide or remove the existing fields, but recreate them with the proper selectors for the new smk fields. It's not pretty, but it should work.

Ray

On Aug 10, 2012, at 7:59 AM, Sébastien Brossard wrote:

Hi all,

I've been trying adding our StructuredSMKDate field to the existing textualInscriptionGroupList/textualInscriptionGroup, which is declared as a <repeat> group.
The service is declared as follow and works well (REST test) :

<xs:element name="textualInscriptionGroupList">
xs:complexType
xs:sequence
<xs:element name="textualInscriptionGroup">
<xs:complexType >
xs:sequence
<xs:element name="inscriptionContentSMKDateGroup" type="structuredDateSMKGroup"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:complexType name="structuredDateSMKGroup">
xs:sequence
<xs:element name="dateSMKDisplayText" type="xs:string"/>
<xs:element name="dateSMKDateDay" type="xs:string"/>
<xs:element name="dateSMKDateMonth" type="xs:string"/>
<xs:element name="dateSMKDateYear" type="xs:string"/>
<xs:element name="dateSMKEraSelector" type="xs:string"/>
<xs:element name="dateSMKSecondDateDay" type="xs:string"/>
<xs:element name="dateSMKSecondDateMonth" type="xs:string"/>
<xs:element name="dateSMKSecondDateYear" type="xs:string"/>
<xs:element name="dateSMKSecondEraSelector" type="xs:string"/>
<xs:element name="dateSMKThirdDateDay" type="xs:string"/>
<xs:element name="dateSMKThirdDateMonth" type="xs:string"/>
<xs:element name="dateSMKThirdDateYear" type="xs:string"/>
<xs:element name="dateSMKThirdEraSelector" type="xs:string"/>
<xs:element name="dateSMKSegmentSelector" type="xs:string"/>
<xs:element name="dateSMKTypeSelector" type="xs:string"/>
<xs:element name="scalarValuesComputed" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>

In the application, I created the following smk-textual-collectionobject.xml file in my tenant:

<record id="collection-object"> <services-record-path id="smk">collectionobjects_smk:http://collectionspace.org/services/collectionobject/local/smk,collectionobjects_smk</services-record-path> <section id="textualInscriptionInformation"> <repeat id="textualInscriptionGroupList/textualInscriptionGroup"> <group id="textualSMKDateGroup" ui-type="groupfield/structureddateSMK" primarykey="dateSMKDisplayText" ui-func="cspace.structuredDateSMK">
                                        <services-tag>textualInscriptionGroupList/textualInscriptionGroup</services-tag>
                                        <selector>object-description-inscription-content-date-smk</selector>

                  <field id="dateSMKDisplayText" section="smk"/>
                                        <field id="dateSMKDateDay" section="smk"/>
                                        <field id="dateSMKDateMonth" section="smk"/>                                                                                                                                                                  <field id="dateSMKDateYear" section="smk"/>
                                        <field id="dateSMKEraSelector" section="smk"/>
                                        <field id="dateSMKSecondDateDay" section="smk"/>
                                        <field id="dateSMKSecondDateMonth" section="smk"/>
                                        <field id="dateSMKSecondDateYear" section="smk"/>
                                        <field id="dateSMKSecondEraSelector" section="smk"/>
                                        <field id="dateSMKThirdDateDay" section="smk"/>
                                        <field id="dateSMKThirdDateMonth" section="smk"/>                                                                                                                                                          <field id="dateSMKThirdDateYear" section="smk"/>
                                        <field id="dateSMKThirdEraSelector" section="smk"/>
                                        <field id="dateSMKSegmentSelector" section="smk"/>
                                        <field id="dateSMKTypeSelector" section="smk"/>
                                        <field id="scalarValuesComputed" ui-search="false" section="smk"/>

                         </group>
     </repeat>
</section> </record>

This file is declared in smk-tenant.xml:
<include src="base-collectionobject.xml,smk-textual-collectionobject.xml" merge="xmlmerge.properties"/>)

The object-description-inscription-content-date-smk  inserted in the UI.

But the problem is the following: in the SMK's Cataloging page, it's not anymore the whole Textual Inscription group that is repeatable, but just the (customized) date field.

After numerous tries without success, I've tried the overlay method (mail to follow...)

Sébastien Brossard
IT-Udvikler
sebastien.brossard@smk.dkmailto:3sebastien.brossard@smk.dkT
Tmailto:3sebastien.brossard@smk.dkT +45 3374 8483

Statens Museum for Kunst
Sølvgade 48-50
DK-1307 København K

T +45 3374 8494
F +45 3374 8404
smk.dkhttp://smk.dk/

<image003.jpg>


Talk mailing list
Talk@lists.collectionspace.orgmailto:Talk@lists.collectionspace.org
http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org

Hi Ray, Thank you for your answer - as you said, it's a work-around, but it works nevertheless. Best regards, Sébastien Fra: Ray Lee [mailto:rhlee@berkeley.edu] Sendt: 16. august 2012 02:31 Til: Sébastien Brossard Cc: talk@lists.collectionspace.org List Emne: Re: [Talk] Add a field in an existing <repeat> (using xmlmerge) Hi Sébastien, The problem, unfortunately, is that you can't inject a field from the smk schema into a complex type from the common schema. You need to recreate the group and all of the fields within it, in the smk schema. There's also the problem that the app layer gets confused if fields/groups in your schema have the same name as fields in the common schema, so everything has to have a different name. In the services layer, the smk schema might look something like this: <xs:element name="smkTextualInscriptionGroupList" type="smkTextualInscriptionGroupList"/> <xs:complexType name="smkTextualInscriptionGroupList"> <xs:sequence> <xs:element name="smkTextualInscriptionGroup" type="smkTextualInscriptionGroup" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="smkTextualInscriptionGroup"> <xs:sequence> <xs:element name="smkInscriptionContent" type="xs:string"/> <xs:element name="smkInscriptionContentInscriber" type="xs:string"/> <xs:element name="smkInscriptionContentDateGroup" type="structuredDateSMKGroup"/> <xs:element name="smkInscriptionContentInterpretation" type="xs:string"/> <xs:element name="smkInscriptionContentLanguage" type="xs:string"/> <xs:element name="smkInscriptionContentMethod" type="xs:string"/> <xs:element name="smkInscriptionContentPosition" type="xs:string"/> <xs:element name="smkInscriptionContentScript" type="xs:string"/> <xs:element name="smkInscriptionContentTranslation" type="xs:string"/> <xs:element name="smkInscriptionContentTransliteration" type="xs:string"/> <xs:element name="smkInscriptionContentType" type="xs:string"/> </xs:sequence> </xs:complexType> Then, in the app layer config, whether you do it using the merge or overlay method, you would define this new group and fields (making sure you use section="smk" on the repeat tag, as well as on the field tags). In the UI, you would hide or remove the existing fields, but recreate them with the proper selectors for the new smk fields. It's not pretty, but it should work. Ray On Aug 10, 2012, at 7:59 AM, Sébastien Brossard wrote: Hi all, I've been trying adding our StructuredSMKDate field to the existing textualInscriptionGroupList/textualInscriptionGroup, which is declared as a <repeat> group. The service is declared as follow and works well (REST test) : <xs:element name="textualInscriptionGroupList"> <xs:complexType> <xs:sequence> <xs:element name="textualInscriptionGroup"> <xs:complexType > <xs:sequence> <xs:element name="inscriptionContentSMKDateGroup" type="structuredDateSMKGroup"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="structuredDateSMKGroup"> <xs:sequence> <xs:element name="dateSMKDisplayText" type="xs:string"/> <xs:element name="dateSMKDateDay" type="xs:string"/> <xs:element name="dateSMKDateMonth" type="xs:string"/> <xs:element name="dateSMKDateYear" type="xs:string"/> <xs:element name="dateSMKEraSelector" type="xs:string"/> <xs:element name="dateSMKSecondDateDay" type="xs:string"/> <xs:element name="dateSMKSecondDateMonth" type="xs:string"/> <xs:element name="dateSMKSecondDateYear" type="xs:string"/> <xs:element name="dateSMKSecondEraSelector" type="xs:string"/> <xs:element name="dateSMKThirdDateDay" type="xs:string"/> <xs:element name="dateSMKThirdDateMonth" type="xs:string"/> <xs:element name="dateSMKThirdDateYear" type="xs:string"/> <xs:element name="dateSMKThirdEraSelector" type="xs:string"/> <xs:element name="dateSMKSegmentSelector" type="xs:string"/> <xs:element name="dateSMKTypeSelector" type="xs:string"/> <xs:element name="scalarValuesComputed" type="xs:boolean"/> </xs:sequence> </xs:complexType> In the application, I created the following smk-textual-collectionobject.xml file in my tenant: <record id="collection-object"> <services-record-path id="smk">collectionobjects_smk:http://collectionspace.org/services/collectionobject/local/smk,collectionobjects_smk</services-record-path> <section id="textualInscriptionInformation"> <repeat id="textualInscriptionGroupList/textualInscriptionGroup"> <group id="textualSMKDateGroup" ui-type="groupfield/structureddateSMK" primarykey="dateSMKDisplayText" ui-func="cspace.structuredDateSMK"> <services-tag>textualInscriptionGroupList/textualInscriptionGroup</services-tag> <selector>object-description-inscription-content-date-smk</selector> <field id="dateSMKDisplayText" section="smk"/> <field id="dateSMKDateDay" section="smk"/> <field id="dateSMKDateMonth" section="smk"/> <field id="dateSMKDateYear" section="smk"/> <field id="dateSMKEraSelector" section="smk"/> <field id="dateSMKSecondDateDay" section="smk"/> <field id="dateSMKSecondDateMonth" section="smk"/> <field id="dateSMKSecondDateYear" section="smk"/> <field id="dateSMKSecondEraSelector" section="smk"/> <field id="dateSMKThirdDateDay" section="smk"/> <field id="dateSMKThirdDateMonth" section="smk"/> <field id="dateSMKThirdDateYear" section="smk"/> <field id="dateSMKThirdEraSelector" section="smk"/> <field id="dateSMKSegmentSelector" section="smk"/> <field id="dateSMKTypeSelector" section="smk"/> <field id="scalarValuesComputed" ui-search="false" section="smk"/> </group> </repeat> </section> </record> This file is declared in smk-tenant.xml: <include src="base-collectionobject.xml,smk-textual-collectionobject.xml" merge="xmlmerge.properties"/>) The object-description-inscription-content-date-smk inserted in the UI. But the problem is the following: in the SMK's Cataloging page, it's not anymore the whole Textual Inscription group that is repeatable, but just the (customized) date field. After numerous tries without success, I've tried the overlay method (mail to follow...) Sébastien Brossard IT-Udvikler sebastien.brossard@smk.dk<mailto:3sebastien.brossard@smk.dkT> T<mailto:3sebastien.brossard@smk.dkT> +45 3374 8483 Statens Museum for Kunst Sølvgade 48-50 DK-1307 København K T +45 3374 8494 F +45 3374 8404 smk.dk<http://smk.dk/> <image003.jpg> _______________________________________________ Talk mailing list Talk@lists.collectionspace.org<mailto:Talk@lists.collectionspace.org> http://lists.collectionspace.org/mailman/listinfo/talk_lists.collectionspace.org