Help with schema-suggestions.xml

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with schema-suggestions.xml

Jo Cook
Hi,

I'm working with schema-suggestions.xml to limit the available options when editing a record. This is working fine up to a point, but I've reached a point where I am seeing unexpected behaviour.


They both fall within gmd:resourceConstraints\gmd:MD_LegalConstraints blocks, but the guidelines state that they must be in separate gmd:resourceConstraints blocks. 

I'm using the following in schema-suggestions.xml (adapted from ISO19139):

 <!-- comment out MD_Constraints because we're not using it -->
  <!-- <field name="gmd:MD_Constraints">
    <suggest name="gmd:useLimitation"/>
  </field> -->

  <!-- restrict resourceConstraints to legal only -->
  <field name="gmd:resourceConstraints">
    <suggest name="gmd:MD_LegalConstraints"/>
  </field>

  <!-- restrict legalConstraints to access or use, plus other -->
  <field name="gmd:MD_LegalConstraints">
    <suggest name="gmd:accessConstraints"/>
    <suggest name="gmd:useConstraints"/>
    <suggest name="gmd:otherConstraints"/>
  </field>

  <!-- other constraints should give option of anchor or text -->
  <field name="gmd:otherConstraints">
    <suggest name="gmx:Anchor"/>
    <suggest name="gco:CharacterString"/>
  </field>

  <!-- comment out SecurityConstraints as we're not using it -->
  <!-- <field name="gmd:MD_SecurityConstraints">
    <suggest name="gmd:classification"/>
    <suggest name="gmd:useLimitation"/>
  </field> -->

However the behaviour I see is that the button to add a new gmd:resourceConstraints block expands immediately to show empty gmd:accessConstraints, gmd:useConstraints  elements (plus gmd:otherConstraints, which is behaving correctly), whereas the behaviour I want is a further option to choose from either gmd:accessConstraints or gmd:useConstraints, in the same way that gmd:otherConstraints offers the choice of either anchor or text.

Is this because gmd:resourceConstraints only contains one option? How can I work around this?

Thanks

Jo
--
Jo Cook
t:+44 7930 524 155/twitter:@archaeogeek
Please note that currently I do not work on Friday afternoons. For urgent responses at that time, please visit support.astuntechnology.com or phone our office on 01372 744009


-- 
Sign up to our mailing list for updates on news, products, conferences, events and training

Astun Technology Ltd, The Coach House, 17 West Street, Epsom, Surrey, KT18 7RL, UK 
t:+44 1372 744 009 w: astuntechnology.com twitter:@astuntech

Company registration no. 5410695. Registered in England and Wales. Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no. 864201149.


_______________________________________________
GeoNetwork-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Help with schema-suggestions.xml

Jose Garcia
Hi Jo

See feedback inline. 

Regards,
Jose García

On Wed, Feb 20, 2019 at 7:01 PM Jo Cook <[hidden email]> wrote:
Hi,

I'm working with schema-suggestions.xml to limit the available options when editing a record. This is working fine up to a point, but I've reached a point where I am seeing unexpected behaviour.


They both fall within gmd:resourceConstraints\gmd:MD_LegalConstraints blocks, but the guidelines state that they must be in separate gmd:resourceConstraints blocks. 

I'm using the following in schema-suggestions.xml (adapted from ISO19139):

 <!-- comment out MD_Constraints because we're not using it -->
  <!-- <field name="gmd:MD_Constraints">
    <suggest name="gmd:useLimitation"/>
  </field> -->

  <!-- restrict resourceConstraints to legal only -->
  <field name="gmd:resourceConstraints">
    <suggest name="gmd:MD_LegalConstraints"/>
  </field>

  <!-- restrict legalConstraints to access or use, plus other -->
  <field name="gmd:MD_LegalConstraints">
    <suggest name="gmd:accessConstraints"/>
    <suggest name="gmd:useConstraints"/>
    <suggest name="gmd:otherConstraints"/>
  </field>

  <!-- other constraints should give option of anchor or text -->
  <field name="gmd:otherConstraints">
    <suggest name="gmx:Anchor"/>
    <suggest name="gco:CharacterString"/>
  </field>

  <!-- comment out SecurityConstraints as we're not using it -->
  <!-- <field name="gmd:MD_SecurityConstraints">
    <suggest name="gmd:classification"/>
    <suggest name="gmd:useLimitation"/>
  </field> -->

However the behaviour I see is that the button to add a new gmd:resourceConstraints block expands immediately to show empty gmd:accessConstraints, gmd:useConstraints  elements (plus gmd:otherConstraints, which is behaving correctly), whereas the behaviour I want is a further option to choose from either gmd:accessConstraints or gmd:useConstraints, in the same way that gmd:otherConstraints offers the choice of either anchor or text.


That's not really possible with schema-suggestions, in gmd:otherConstraints works for gmx:Anchor/gco:CharacterString as gmx:Anchor is a replacement for gco:CharacterString.

But for gmd:accessConstraints and gmd:useConstraints are different elements inside gmd:MD_LegalConstraints

gmd:useLimitation [0..*]    
gmd:accessConstraints [0..*]    
gmd:useConstraints [0..*]    
gmd:otherConstraints [0..*]    

So both are suggested from the previous configuration, you can't decide to have with the suggestions mechanism in these cases a selection.


Is this because gmd:resourceConstraints only contains one option? How can I work around this?

There're other alternatives to accomplish this kind of stuff, customizing the metadata view for gmd:resourceConstraints 

I'll send you some work done in other similar profiles to deal with the resource constraints in the scope of INSPIRE, I hope can work for GEMINI 2.3 schema also as requirements look similar.
 

Thanks

Jo
--
Jo Cook
t:+44 7930 524 155/twitter:@archaeogeek
Please note that currently I do not work on Friday afternoons. For urgent responses at that time, please visit support.astuntechnology.com or phone our office on 01372 744009


-- 
Sign up to our mailing list for updates on news, products, conferences, events and training

Astun Technology Ltd, The Coach House, 17 West Street, Epsom, Surrey, KT18 7RL, UK 
t:+44 1372 744 009 w: astuntechnology.com twitter:@astuntech

Company registration no. 5410695. Registered in England and Wales. Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no. 864201149.
_______________________________________________
GeoNetwork-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork


--
Vriendelijke groeten / Kind regards,

Jose García


Veenderweg 13
6721 WD Bennekom
The Netherlands
T: <a href="tel:+31318416664" style="font-family:Helvetica,Arial,sans-serif" target="_blank">+31 (0)318 416664

  

Please consider the environment before printing this email.


_______________________________________________
GeoNetwork-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork