[GeoNetwork-devel] Custom editor view - Set field no editable (readonly)

Hello there,

Anyone could help me with my custom editor view? I don’t know how to set a field ‘no editable’.

How could I make the fields under ‘gmd:DQ_DomainConsistency’ elements to be readonly fields? For example, the “Title” element (gmd:DQ_ConformanceResult/gmd:specification/gmd:CI_Citation/gmd:title).

Any kind of help would be appreciate.

Best regards,

Amaia Martínez

Hi Amaya

I see 2 solutions:

  1. Add a xslt template that match the gmd:DQ_DomainConsistency to don’t display it in the editor (if it’s required to be displayed in the editor, this solution is not

<xsl:template mode=“mode-iso19139” priority=“5000” match=“gmd:DQ_DomainConsistency” />

You can add it to this file https://github.com/geonetwork/core-geonetwork/blob/3.4.x/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields.xsl

  1. Make child elements inside gmd:DQ_DomainConsistency to be readonly, like in this template:

https://github.com/geonetwork/core-geonetwork/blob/3.4.x/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields.xsl#L43-L44

<xsl:template mode=“mode-iso19139” priority=“2100” match=“gmd:fileIdentifier|gmd:dateStamp”>

You need to extend that template or add a similar one for the elements inside gmd:DQ_DomainConsistency that you need as readonly.

Regards,
Jose García

(attachments)

image001.jpg

···

On Thu, Feb 1, 2018 at 12:06 PM, Amaya Martínez Echeverría <amartinez@anonymised.com> wrote:

Hello there,

Anyone could help me with my custom editor view? I don’t know how to set a field ‘no editable’.

How could I make the fields under ‘gmd:DQ_DomainConsistency’ elements to be readonly fields? For example, the “Title” element (gmd:DQ_ConformanceResult/gmd:specification/gmd:CI_Citation/gmd:title).

Any kind of help would be appreciate.

Best regards,

Amaia Martínez


AVISO SOBRE CONFIDENCIALIDAD: La información incluida en este mensaje es CONFIDENCIAL y de uso EXCLUSIVO a su FINALIDAD. Su posterior divulgación será responsabilidad de quien la realice


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


GeoNetwork-devel mailing list
GeoNetwork-devel@…537…sourceforge.net
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: +31 (0)318 416664

Please consider the environment before printing this email.

Hi Jose,

First of all, thanks for the quick answer. I don’t know Geonetwork as I’ve been analyzing only which could we adapt or not with ‘simple customizations’ (not involving code modifying or similar).

The first solution is not valid because we need the fields to be shown. So I would like to try the second one, but I’m lost… the Geonetwork’s online documentation doesn’t talk about this kind of extension. How could I extend that template? Or should I have to edit the “metadata-edit.xsl” file?

Thanks in advance,

Best regards,

Amaia Martínez.

Enviado el: jueves, 01 de febrero de 2018 12:28

(attachments)

image001.jpg

···

Hi Amaya

I see 2 solutions:

  1. Add a xslt template that match the gmd:DQ_DomainConsistency to don’t display it in the editor (if it’s required to be displayed in the editor, this solution is not

<xsl:template mode=“mode-iso19139” priority=“5000” match=“gmd:DQ_DomainConsistency” />

You can add it to this file https://github.com/geonetwork/core-geonetwork/blob/3.4.x/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields.xsl

  1. Make child elements inside gmd:DQ_DomainConsistency to be readonly, like in this template:

https://github.com/geonetwork/core-geonetwork/blob/3.4.x/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields.xsl#L43-L44

<xsl:template mode=“mode-iso19139” priority=“2100” match=“gmd:fileIdentifier|gmd:dateStamp”>

You need to extend that template or add a similar one for the elements inside gmd:DQ_DomainConsistency that you need as readonly.

Regards,

Jose García

On Thu, Feb 1, 2018 at 12:06 PM, Amaya Martínez Echeverría <amartinez@…1055…> wrote:

Hello there,

Anyone could help me with my custom editor view? I don’t know how to set a field ‘no editable’.

How could I make the fields under ‘gmd:DQ_DomainConsistency’ elements to be readonly fields? For example, the “Title” element (gmd:DQ_ConformanceResult/gmd:specification/gmd:CI_Citation/gmd:title).

Any kind of help would be appreciate.

Best regards,

Amaia Martínez


AVISO SOBRE CONFIDENCIALIDAD: La información incluida en este mensaje es CONFIDENCIAL y de uso EXCLUSIVO a su FINALIDAD. Su posterior divulgación será responsabilidad de quien la realice


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
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: +31 (0)318 416664

Please consider the environment before printing this email.

Hi Amaya

Afaik, in GN 3.x+ the file metadata-edit.xsl inside the metadata schemas is not used.

This page has documentation about metadata schemas that can be useful: https://geonetwork-opensource.org/manuals/3.4.x/en/customizing-application/implementing-a-schema-plugin.html

The change you require, for now requires to do some xslt development. In GN 3.x+, the metadata editor views and other settings can be customised in this file https://github.com/geonetwork/core-geonetwork/blob/3.4.x/schemas/iso19139/src/main/plugin/iso19139/layout/config-editor.xml, but not for which elements should be readonly (that can be a nice extension to add in the future).

For now it requires some xslt development, you could add the list of elements in this template in the match section, but be aware that would not be just for example to add gmd:title, as otherwise all gmd:title will be set as readonly, requires to add the element with some condition to check the parent:

https://github.com/geonetwork/core-geonetwork/blob/3.4.x/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields.xsl#L43-L44

Regards,
Jose García

(attachments)

image001.jpg

···

On Thu, Feb 1, 2018 at 12:47 PM, Amaya Martínez Echeverría <amartinez@anonymised.com> wrote:

Hi Jose,

First of all, thanks for the quick answer. I don’t know Geonetwork as I’ve been analyzing only which could we adapt or not with ‘simple customizations’ (not involving code modifying or similar).

The first solution is not valid because we need the fields to be shown. So I would like to try the second one, but I’m lost… the Geonetwork’s online documentation doesn’t talk about this kind of extension. How could I extend that template? Or should I have to edit the “metadata-edit.xsl” file?

Thanks in advance,

Best regards,

Amaia Martínez.

De: Jose Garcia [mailto:jose.garcia@anonymised.com]
Enviado el: jueves, 01 de febrero de 2018 12:28
Para: Amaya Martínez Echeverría <amartinez@anonymised.com>
CC: geonetwork-devel@anonymised.comsourceforge.net
Asunto: Re: [GeoNetwork-devel] Custom editor view - Set field no editable (readonly)

Hi Amaya

I see 2 solutions:

  1. Add a xslt template that match the gmd:DQ_DomainConsistency to don’t display it in the editor (if it’s required to be displayed in the editor, this solution is not

<xsl:template mode=“mode-iso19139” priority=“5000” match=“gmd:DQ_DomainConsistency” />

You can add it to this file https://github.com/geonetwork/core-geonetwork/blob/3.4.x/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields.xsl

  1. Make child elements inside gmd:DQ_DomainConsistency to be readonly, like in this template:

https://github.com/geonetwork/core-geonetwork/blob/3.4.x/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields.xsl#L43-L44

<xsl:template mode=“mode-iso19139” priority=“2100” match=“gmd:fileIdentifier|gmd:dateStamp”>

You need to extend that template or add a similar one for the elements inside gmd:DQ_DomainConsistency that you need as readonly.

Regards,

Jose García

On Thu, Feb 1, 2018 at 12:06 PM, Amaya Martínez Echeverría <amartinez@anonymised.com> wrote:

Hello there,

Anyone could help me with my custom editor view? I don’t know how to set a field ‘no editable’.

How could I make the fields under ‘gmd:DQ_DomainConsistency’ elements to be readonly fields? For example, the “Title” element (gmd:DQ_ConformanceResult/gmd:specification/gmd:CI_Citation/gmd:title).

Any kind of help would be appreciate.

Best regards,

Amaia Martínez


AVISO SOBRE CONFIDENCIALIDAD: La información incluida en este mensaje es CONFIDENCIAL y de uso EXCLUSIVO a su FINALIDAD. Su posterior divulgación será responsabilidad de quien la realice


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


GeoNetwork-devel mailing list
GeoNetwork-devel@anonymised.comsourceforge.net
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: +31 (0)318 416664

Please consider the environment before printing this email.


AVISO SOBRE CONFIDENCIALIDAD: La información incluida en este mensaje es CONFIDENCIAL y de uso EXCLUSIVO a su FINALIDAD. Su posterior divulgación será responsabilidad de quien la realice

–

Vriendelijke groeten / Kind regards,

Jose García


Veenderweg 13
6721 WD Bennekom
The Netherlands
T: +31 (0)318 416664

Please consider the environment before printing this email.