add datepicker with indeterminate position to iso19139 schema. fix datepicker. layout fix #9151
add datepicker with indeterminate position to iso19139 schema. fix datepicker. layout fix #9151davidblasby wants to merge 9 commits intomainfrom
Conversation
There was a problem hiding this comment.
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
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"> |
| <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"> |
|
Localities in Victoria GML-32.xml ^^ These are a test case for GML (old) and GML (3.2) |
|
@josegar74 - when you look at this, please also press the "validate" button. |
| class="form-control gn-time" | ||
| data-ng-class="hideTime == 'true' ? 'hidden' : ''" | ||
| data-ng-model="time" | ||
| data-ng-show="mode === ''" |
There was a problem hiding this comment.
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:
…tepicker. layout fix # Conflicts: # web-ui/src/main/resources/catalog/components/edit/datepicker/partials/datepicker.html
f33781f to
efd8b22
Compare
|
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? |
|
| @import "gn_view.less"; | ||
|
|
||
| //ensure gn-beginPosition has the label displayed | ||
| .gn-beginPosition { |
There was a problem hiding this comment.
Is this style used? I can't find it in the HTML of the metadata editor
There was a problem hiding this comment.
yes - its automagically added.
There was a problem hiding this comment.
Can you point where is added? I could not find it
| var namespaceURI = gnSchemaManagerService.findNamespaceUri( | ||
| namespace, | ||
| gnCurrentEdit.schema | ||
| ); | ||
| if (namespaceURI !== undefined) { | ||
| elementNSDef = " xmlns:" + namespace + '="' + namespaceURI + '"'; | ||
| } |
There was a problem hiding this comment.
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 = "";
}There was a problem hiding this comment.
I don't think efficiency is important here.
josegar74
left a comment
There was a problem hiding this comment.
@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]" |
There was a problem hiding this comment.
| 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.
There was a problem hiding this comment.
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)).
There was a problem hiding this comment.
@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/...).
There was a problem hiding this comment.
@josegar74 - I've pushed another commit.
- changes some of the XPATHs to
local-namematching for thegml:/gml320:prefixes - added your match, above (converted to
local-namematching)
I'm not sure how to test what you found (unable to add TimeInstant). I think (not sure) that its still problematic.
…r more exact matching
|










This PR:
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.
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.
if the indeterminateposition is now/unknown, you cannot enter the date/time:

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
mainbranch, backports managed with labelREADME.mdfilespom.xmldependency management. Update build documentation with intended library use and library tutorials or documentation