Skip to content

Commit

Permalink
Index / Add maintenance details.
Browse files Browse the repository at this point in the history
Before only maintenance frequency was displayed but more information may be provided about the maintenance (eg. custom frequency, next update date, note).
  • Loading branch information
fxprunayre committed Aug 19, 2024
1 parent 57bc1d5 commit b874f86
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ private void checkIndexResponse(BulkResponse bulkItemResponses,
.add("status_text")
.add("coordinateSystem")
.add("identifier")
.add("maintenance")
.add("responsibleParty")
.add("mdLanguage")
.add("otherLanguage")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,22 @@
</spatialRepresentationType>
</xsl:for-each>

<xsl:for-each select="*:resourceMaintenance/*">
<maintenance type="object">{
"frequency": "<xsl:value-of select="*:maintenanceAndUpdateFrequency/*/@codeListValue"/>"
<xsl:for-each select="*:dateOfNextUpdate[*/text() != '']">
,"nextUpdateDate": "<xsl:value-of select="*/text()"/>"
</xsl:for-each>
<xsl:for-each select="*:userDefinedMaintenanceFrequency[*/text() != '']">
,"userDefinedFrequency": "<xsl:value-of select="*/text()"/>"
</xsl:for-each>
<xsl:for-each select="*:maintenanceNote[*/text() != '']">
,"noteObject":
<xsl:value-of select="gn-fn-index:add-multilingual-field('maintenanceNote', ., $allLanguages, true())"/>
</xsl:for-each>
}</maintenance>
</xsl:for-each>

<xsl:for-each select="mri:resourceConstraints/*">
<xsl:variable name="fieldPrefix" select="local-name()"/>

Expand Down
16 changes: 16 additions & 0 deletions schemas/iso19139/src/main/plugin/iso19139/index-fields/index.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,22 @@
</xsl:for-each>


<xsl:for-each select="gmd:resourceMaintenance/*">
<maintenance type="object">{
"frequency": "<xsl:value-of select="*:maintenanceAndUpdateFrequency/*/@codeListValue"/>"
<xsl:for-each select="gmd:dateOfNextUpdate[*/text() != '']">
,"nextUpdateDate": "<xsl:value-of select="*/text()"/>"
</xsl:for-each>
<xsl:for-each select="gmd:userDefinedMaintenanceFrequency[*/text() != '']">
,"userDefinedFrequency": "<xsl:value-of select="*/text()"/>"
</xsl:for-each>
<xsl:for-each select="gmd:maintenanceNote[*/text() != '']">
,"noteObject":
<xsl:value-of select="gn-fn-index:add-multilingual-field('maintenanceNote', ., $allLanguages, true())"/>
</xsl:for-each>
}</maintenance>
</xsl:for-each>

<xsl:for-each select="gmd:resourceConstraints/*">
<xsl:variable name="fieldPrefix" select="local-name()"/>
<xsl:for-each select="gmd:otherConstraints">
Expand Down
3 changes: 3 additions & 0 deletions web-ui/src/main/resources/catalog/locales/en-v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,9 @@
"measureDescription": "Description",
"measureValue": "Value",
"measureDate": "Date",
"nextUpdateDate": "Next update",
"userDefinedFrequency": "Update frequency",
"maintenanceNote": "Maintenance note",
"switchPortals": "Switch to another Portal",
"dataPreview": "Discover data",
"tableOfContents": "Table of Contents",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<div data-ng-repeat="maintenance in mdView.current.record.maintenance">
<div data-ng-if="maintenance.frequency" class="gn-margin-bottom flex-row">
<span class="badge badge-rounded" title="{{'updateFrequency' | translate}}">
<i class="fa fa-fw fa-rotate"></i>
</span>
<div>
<h3 data-translate="">updateFrequency</h3>
<p>{{maintenance.frequency | translate}}</p>
</div>
</div>
<div data-ng-if="maintenance.noteObject.default" class="gn-margin-bottom flex-row">
<span class="badge badge-rounded" title="{{'maintenanceNote' | translate}}">
<i class="fa fa-fw fa-rotate"></i>
</span>
<div>
<h3 data-translate="">maintenanceNote</h3>
<p>{{maintenance.noteObject.default}}</p>
</div>
</div>
<div data-ng-if="maintenance.nextUpdateDate" class="gn-margin-bottom flex-row">
<span class="badge badge-rounded" title="{{'nextUpdateDate' | translate}}">
<i class="fa fa-fw fa-calendar-plus"></i>
</span>
<div>
<h3 data-translate="">nextUpdateDate</h3>
<p>{{maintenance.nextUpdateDate}}</p>
</div>
</div>
<div data-ng-if="maintenance.userDefinedFrequency" class="gn-margin-bottom flex-row">
<span class="badge badge-rounded" title="{{'userDefinedFrequency' | translate}}">
<i class="fa fa-fw fa-rotate"></i>
</span>
<div>
<h3 data-translate="">userDefinedFrequency</h3>
<p data-gn-field-duration-div="{{maintenance.userDefinedFrequency}}"></p>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ <h3>{{date.type | translate}}</h3>
</ul>
</section>

<div ng-include="'../../catalog/views/default/templates/recordView/maintenance.html'"></div>

<div data-ng-if="mdView.current.record.serviceType" class="gn-margin-bottom flex-row">
<span class="badge badge-rounded" title="{{'serviceType' | translate}}">
<i class="fa fa-fw fa-cloud"></i>
Expand Down Expand Up @@ -49,21 +51,6 @@ <h3 data-translate="">cl_couplingType</h3>
<p data-ng-repeat="c in mdView.current.record.cl_couplingType">{{c.default}}</p>
</div>
</div>

<div
data-ng-if="mdView.current.record.cl_maintenanceAndUpdateFrequency.length > 0"
class="gn-margin-bottom flex-row"
>
<span class="badge badge-rounded" title="{{'updateFrequency' | translate}}">
<i class="fa fa-fw fa-language"></i>
</span>
<div>
<h3 data-translate="">updateFrequency</h3>
<p data-ng-repeat="c in mdView.current.record.cl_maintenanceAndUpdateFrequency">
{{c.default}}
</p>
</div>
</div>
</div>

<div>
Expand Down

0 comments on commit b874f86

Please sign in to comment.