Skip to content

add datepicker with indeterminate position to iso19139 schema. fix datepicker. layout fix - #9151

Open
davidblasby wants to merge 14 commits into
mainfrom
_date_indeterminate
Open

add datepicker with indeterminate position to iso19139 schema. fix datepicker. layout fix #9151
davidblasby wants to merge 14 commits into
mainfrom
_date_indeterminate

Conversation

@davidblasby

Copy link
Copy Markdown
Contributor

This PR:

  1. fix a UX issue with the datepicker. It resets the date/time when the indeterminateposition is now/unknown. However, the user could still change the date and time. When they save/reload, the time/date would be reset to blank - which is a bit confusing. The fix turns off the date/time control if the indeterminateposition is now/unknown.

  2. Before, the extent was just a simple date picker (one field). If it was left blank, it would produce an indexing error. Now, the user can select a indeterminateposition as now (still being updated) or unknown (user doesn't know). This will set the indeterminatePosition flag on the element and there will not be an indexing error.

image image

if the indeterminateposition is now/unknown, you cannot enter the date/time:
image

NOTE: this uses a template so it follows the same mechanism as in HNAP (see metadata101/iso19139.ca.HNAP#468)

Also, see HNAP PR: metadata101/iso19139.ca.HNAP#468

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

@josegar74 josegar74 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the comments.

Also the section label is Extent, probably from the parent element. It would be better to check if possible to use Temporal extent .

It also handles gml:beginPosition, gml:endPosition. To check also to support the old namespace as in

match="gml:beginPosition|gml:endPosition|gml:timePosition|
gml320:beginPosition|gml320:endPosition|gml320:timePosition"

I think also gml:timePosition should be supported as supports indeterminatePosition. See https://www.datypic.com/sc/niem21/e-gml32_timePosition.html

<gmd:extent>
    <gml:TimePeriod gml:id="d57e396a1052958">
        <gml:relatedTime>
            <gml:TimeInstant gml:id="d1672e245a1052958">
                <gml:relatedTime>
                    <gml:TimePeriod gml:id="d1672e247a1052958">
                        <gml:begin>
                            <gml:TimeInstant gml:id="d1672e249a1052958">
                                <gml:timePosition/>
                            </gml:TimeInstant>
                        </gml:begin>
                        <gml:end>
                            <gml:TimeInstant gml:id="d1672e252a1052958">
                                <gml:timePosition/>
                            </gml:TimeInstant>
                        </gml:end>
                    </gml:TimePeriod>
                </gml:relatedTime>
                
            </gml:TimeInstant>
        </gml:relatedTime>        
    </gml:TimePeriod>
</gmd:extent>


<xsl:variable name="indeterminatePosition" select="@indeterminatePosition" />

<xsl:variable name="directiveAttributes">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems not used.

<xsl:variable name="value" select="normalize-space(text())"/>
<xsl:variable name="isoType" select="if (../@gco:isoType) then ../@gco:isoType else ''"/>
<xsl:variable name="labelConfig" select="gn-fn-metadata:getLabel($schema, name(), $labels, name(..), $isoType, $xpath)"/>
<xsl:variable name="attributes">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems not used

@davidblasby

Copy link
Copy Markdown
Contributor Author

made minor change to the css there is a "temporal extent" tag:

image

Not perfect, but should be ok.

@davidblasby

Copy link
Copy Markdown
Contributor Author

Localities in Victoria GML-32.xml
Localities in Victoria GML OLD.xml

^^ These are a test case for GML (old) and GML (3.2)

@davidblasby

Copy link
Copy Markdown
Contributor Author

@josegar74 - when you look at this, please also press the "validate" button.

@ianwallen ianwallen added this to the 4.4.10 milestone Feb 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be disabled too when the time and date are disabled:

Image

class="form-control gn-time"
data-ng-class="hideTime == 'true' ? 'hidden' : ''"
data-ng-model="time"
data-ng-show="mode === ''"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data-ng-show has conflicts with the new date only mode introduced in #9153

But once that is resolved both functionalities seem to work apart from some UI issues:

Image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UI does not seem to match the rest of the form:

Image Image Image Image

@davidblasby

Copy link
Copy Markdown
Contributor Author

I think I've addressed tyler's feedback:

extent.mp4

@josegar74 - see tyler's images (above) and the last few seconds of the video. Perhaps you could (if needed) get the sections correct?

@sonarqubecloud

Copy link
Copy Markdown

@import "gn_view.less";

//ensure gn-beginPosition has the label displayed
.gn-beginPosition {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this style used? I can't find it in the HTML of the metadata editor

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes - its automagically added.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point where is added? I could not find it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

you can see that the XSLT adds in gn-* classes.

Comment on lines +365 to +371
var namespaceURI = gnSchemaManagerService.findNamespaceUri(
namespace,
gnCurrentEdit.schema
);
if (namespaceURI !== undefined) {
elementNSDef = " xmlns:" + namespace + '="' + namespaceURI + '"';
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would not be more efficient to put this code in the else of:

              //if data-assume-gml-ns is set, then don't put in the NS declaration
              if (scope.assumeGmlNs === "true" && namespace === "gml") {
                elementNSDef = "";
              }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think efficiency is important here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case is ok.

@josegar74 josegar74 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidblasby an issue I found is that in the full view, it seems using the template also, so you can not really add a Time instant

@davidblasby

davidblasby commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

@davidblasby an issue I found is that in the full view, it seems using the template also, so you can not really add a Time instant

ok, will wait for your feedback and take a look tomorrow or the next day.

This is basically a stand-in for the <field name="temporalRangeSection"> and uses the same template to do the controls.
-->
<xsl:template mode="mode-iso19139"
match="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement[//gml:beginPosition]"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
match="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement[//gml:beginPosition]"
match="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement[gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod//gml:beginPosition]"

@david-blasby this change target better the element and solves the problems with the full view. Please give a try and let me know.

@davidblasby davidblasby Mar 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some issues with the sample data, so I had to update this to:

match="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement[//local-name()='beginPosition']"

(i.e. handle multiple GML "versions" by using local-name instead of a prefixed name (ie. gml:beginPosition)).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josegar74 - I'm not sure how that will work. Here is a typical beginPosition XML (from the GN sample data):

<gmd:extent>
    <gmd:EX_Extent>
        <gmd:temporalElement>
            <gmd:EX_TemporalExtent>
                <gmd:extent>
                    <gml:TimePeriod xmlns:gml="http://www.opengis.net/gml/3.2" gml:id="d3773e252a1052958">
                        <gml:beginPosition indeterminatePosition="before">2000-01-01T04:29:00</gml:beginPosition>
                        <gml:endPosition indeterminatePosition="after">2008-01-08T05:29:00</gml:endPosition>
                    </gml:TimePeriod>
                </gmd:extent>
            </gmd:EX_TemporalExtent>
        </gmd:temporalElement>
    </gmd:EX_Extent>
</gmd:extent>

I'm not sure how:

match="gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement[gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod//gml:beginPosition]"

will match this. Perhaps I am unfamiliar where the "[" will occur. I I thought it would evaluate at the gmd:temporalElement location (i.e. requires gmd:temporalElement/gmd:EX_TemporalExtent/...).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josegar74 - I've pushed another commit.

  1. changes some of the XPATHs to local-name matching for the gml:/gml320: prefixes
  2. added your match, above (converted to local-name matching)

I'm not sure how to test what you found (unable to add TimeInstant). I think (not sure) that its still problematic.

@sonarqubecloud

Copy link
Copy Markdown

@tylerjmchugh

Copy link
Copy Markdown
Contributor

I still see some issues with formatting in HNAP as well as iso19139:

image

Additionally I still seem to get the indexing error when end is set to "unknown" for example:

image

Comment thread schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields.xsl Outdated
Comment thread web-ui/src/main/resources/catalog/views/default/less/gn_editor_default.less Outdated
…o display the container and templates to remove empty sections
@josegar74
josegar74 force-pushed the _date_indeterminate branch from 327d533 to 144bace Compare May 12, 2026 07:06
@josegar74

Copy link
Copy Markdown
Member

@tylerjmchugh please check latest changes to improve the rendering, thanks

@tylerjmchugh tylerjmchugh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josegar74 @davidblasby

I still see the same issues with HNAP:
image

  • Temporal Extent header is not in a collapsible section like it was before
  • Field length should match other fields
  • We should not see indexing errors when we use an unknown end date

Not sure if that is to be addressed here or in the HNAP PR. The changes seem ok in iso19139.

@josegar74

josegar74 commented May 22, 2026

Copy link
Copy Markdown
Member

@tylerjmchugh

Using also metadata101/iso19139.ca.HNAP#468

I get the following rendering, which looks fine, and selecting the end date indeterminate position as Now the warning is not displayed, that seems correct according to https://github.com/metadata101/iso19139.ca.HNAP/blob/4f14270ad6aa56e5d16f8f3bed0e8e425303366c/src/main/plugin/iso19139.ca.HNAP/index-fields/index.xsl#L768-L769

image

With the value Unknown the validation reports the warning, but the index file doesn't check that value, maybe requires to be updated?

There some changes for iso19139 metadata schema files that need to be applied also in HNAP, I will check about that.

@sonarqubecloud

Copy link
Copy Markdown

@josegar74 josegar74 modified the milestones: 4.4.10, 4.4.12 Jun 6, 2026
@fxprunayre fxprunayre modified the milestones: 4.4.12, 4.4.13 Jul 8, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants