Skip to content

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

Open
davidblasby wants to merge 9 commits intomainfrom
_date_indeterminate
Open

add datepicker with indeterminate position to iso19139 schema. fix datepicker. layout fix #9151
davidblasby wants to merge 9 commits intomainfrom
_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

Copy link
Copy Markdown
Member

@josegar74 josegar74 left a comment

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.

Copy link
Copy Markdown
Member

@josegar74 josegar74 left a comment

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
Copy link
Copy Markdown
Contributor Author

davidblasby commented Feb 24, 2026

@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.

Copy link
Copy Markdown
Contributor Author

@davidblasby davidblasby Mar 27, 2026

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

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.

5 participants