Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iso19139.mcp-1.4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenWork
Metadata 101
iso19139.mcp-1.4
Commits
51f94730
Commit
51f94730
authored
Apr 24, 2019
by
ByronCinNZ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added needed changes to multiple files to bring in line with GN 3.4 + releases.
parent
a3a5f901
Changes
50
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
50 changed files
with
9030 additions
and
320 deletions
+9030
-320
src/main/plugin/iso19139.mcp-1.4/formatter/config.properties
src/main/plugin/iso19139.mcp-1.4/formatter/config.properties
+26
-0
src/main/plugin/iso19139.mcp-1.4/formatter/full_view/view.groovy
...n/plugin/iso19139.mcp-1.4/formatter/full_view/view.groovy
+30
-0
src/main/plugin/iso19139.mcp-1.4/formatter/groovy/iso19139/Functions.groovy
...o19139.mcp-1.4/formatter/groovy/iso19139/Functions.groovy
+109
-0
src/main/plugin/iso19139.mcp-1.4/formatter/groovy/iso19139/Handlers.groovy
...so19139.mcp-1.4/formatter/groovy/iso19139/Handlers.groovy
+464
-0
src/main/plugin/iso19139.mcp-1.4/formatter/groovy/iso19139/Matchers.groovy
...so19139.mcp-1.4/formatter/groovy/iso19139/Matchers.groovy
+93
-0
src/main/plugin/iso19139.mcp-1.4/formatter/groovy/iso19139/SummaryFactory.groovy
...9.mcp-1.4/formatter/groovy/iso19139/SummaryFactory.groovy
+232
-0
src/main/plugin/iso19139.mcp-1.4/formatter/html/citation.html
...main/plugin/iso19139.mcp-1.4/formatter/html/citation.html
+40
-0
src/main/plugin/iso19139.mcp-1.4/formatter/html/coupled-resources.html
...in/iso19139.mcp-1.4/formatter/html/coupled-resources.html
+35
-0
src/main/plugin/iso19139.mcp-1.4/formatter/html/format.html
src/main/plugin/iso19139.mcp-1.4/formatter/html/format.html
+47
-0
src/main/plugin/iso19139.mcp-1.4/formatter/html/graphic-overview.html
...gin/iso19139.mcp-1.4/formatter/html/graphic-overview.html
+35
-0
src/main/plugin/iso19139.mcp-1.4/formatter/html/keyword.html
src/main/plugin/iso19139.mcp-1.4/formatter/html/keyword.html
+33
-0
src/main/plugin/iso19139.mcp-1.4/formatter/html/locale.html
src/main/plugin/iso19139.mcp-1.4/formatter/html/locale.html
+30
-0
src/main/plugin/iso19139.mcp-1.4/formatter/html/online-resource.html
...ugin/iso19139.mcp-1.4/formatter/html/online-resource.html
+30
-0
src/main/plugin/iso19139.mcp-1.4/formatter/html/single-resource.html
...ugin/iso19139.mcp-1.4/formatter/html/single-resource.html
+32
-0
src/main/plugin/iso19139.mcp-1.4/formatter/loc/ca-strings.json
...ain/plugin/iso19139.mcp-1.4/formatter/loc/ca-strings.json
+30
-0
src/main/plugin/iso19139.mcp-1.4/formatter/loc/en-strings.json
...ain/plugin/iso19139.mcp-1.4/formatter/loc/en-strings.json
+30
-0
src/main/plugin/iso19139.mcp-1.4/formatter/loc/es-strings.json
...ain/plugin/iso19139.mcp-1.4/formatter/loc/es-strings.json
+30
-0
src/main/plugin/iso19139.mcp-1.4/formatter/loc/fr-strings.json
...ain/plugin/iso19139.mcp-1.4/formatter/loc/fr-strings.json
+26
-0
src/main/plugin/iso19139.mcp-1.4/formatter/loc/ge-strings.json
...ain/plugin/iso19139.mcp-1.4/formatter/loc/ge-strings.json
+26
-0
src/main/plugin/iso19139.mcp-1.4/formatter/loc/it-strings.json
...ain/plugin/iso19139.mcp-1.4/formatter/loc/it-strings.json
+26
-0
src/main/plugin/iso19139.mcp-1.4/formatter/loc/ko-strings.json
...ain/plugin/iso19139.mcp-1.4/formatter/loc/ko-strings.json
+8
-0
src/main/plugin/iso19139.mcp-1.4/formatter/loc/nl-strings.json
...ain/plugin/iso19139.mcp-1.4/formatter/loc/nl-strings.json
+8
-0
src/main/plugin/iso19139.mcp-1.4/formatter/loc/sk-strings.json
...ain/plugin/iso19139.mcp-1.4/formatter/loc/sk-strings.json
+30
-0
src/main/plugin/iso19139.mcp-1.4/formatter/partial_view/config.properties
...iso19139.mcp-1.4/formatter/partial_view/config.properties
+24
-0
src/main/plugin/iso19139.mcp-1.4/formatter/partial_view/view.groovy
...lugin/iso19139.mcp-1.4/formatter/partial_view/view.groovy
+28
-0
src/main/plugin/iso19139.mcp-1.4/formatter/schema-org/config.properties
...n/iso19139.mcp-1.4/formatter/schema-org/config.properties
+24
-0
src/main/plugin/iso19139.mcp-1.4/formatter/schema-org/view.xsl
...ain/plugin/iso19139.mcp-1.4/formatter/schema-org/view.xsl
+927
-0
src/main/plugin/iso19139.mcp-1.4/formatter/xml_view/view.xsl
src/main/plugin/iso19139.mcp-1.4/formatter/xml_view/view.xsl
+75
-0
src/main/plugin/iso19139.mcp-1.4/formatter/xsl-view/config.properties
...gin/iso19139.mcp-1.4/formatter/xsl-view/config.properties
+24
-0
src/main/plugin/iso19139.mcp-1.4/formatter/xsl-view/view.xsl
src/main/plugin/iso19139.mcp-1.4/formatter/xsl-view/view.xsl
+1020
-0
src/main/plugin/iso19139.mcp-1.4/index-fields.xsl
src/main/plugin/iso19139.mcp-1.4/index-fields.xsl
+0
-172
src/main/plugin/iso19139.mcp-1.4/index-fields/default.xsl
src/main/plugin/iso19139.mcp-1.4/index-fields/default.xsl
+1332
-0
src/main/plugin/iso19139.mcp-1.4/index-fields/index-subtemplate.xsl
...lugin/iso19139.mcp-1.4/index-fields/index-subtemplate.xsl
+45
-0
src/main/plugin/iso19139.mcp-1.4/index-fields/index.xsl
src/main/plugin/iso19139.mcp-1.4/index-fields/index.xsl
+41
-0
src/main/plugin/iso19139.mcp-1.4/index-fields/language-default.xsl
...plugin/iso19139.mcp-1.4/index-fields/language-default.xsl
+695
-0
src/main/plugin/iso19139.mcp-1.4/layout/dispatcher.xsl
src/main/plugin/iso19139.mcp-1.4/layout/dispatcher.xsl
+16
-14
src/main/plugin/iso19139.mcp-1.4/layout/evaluate.xsl
src/main/plugin/iso19139.mcp-1.4/layout/evaluate.xsl
+69
-0
src/main/plugin/iso19139.mcp-1.4/layout/utility-tpl-multilingual.xsl
...ugin/iso19139.mcp-1.4/layout/utility-tpl-multilingual.xsl
+2
-0
src/main/plugin/iso19139.mcp-1.4/layout/utility-tpl.xsl
src/main/plugin/iso19139.mcp-1.4/layout/utility-tpl.xsl
+9
-1
src/main/plugin/iso19139.mcp-1.4/present/csw/csw-brief.xsl
src/main/plugin/iso19139.mcp-1.4/present/csw/csw-brief.xsl
+93
-0
src/main/plugin/iso19139.mcp-1.4/present/csw/csw-full.xsl
src/main/plugin/iso19139.mcp-1.4/present/csw/csw-full.xsl
+354
-0
src/main/plugin/iso19139.mcp-1.4/present/csw/csw-summary.xsl
src/main/plugin/iso19139.mcp-1.4/present/csw/csw-summary.xsl
+124
-0
src/main/plugin/iso19139.mcp-1.4/present/csw/own-brief.xsl
src/main/plugin/iso19139.mcp-1.4/present/csw/own-brief.xsl
+94
-0
src/main/plugin/iso19139.mcp-1.4/present/csw/own-full.xsl
src/main/plugin/iso19139.mcp-1.4/present/csw/own-full.xsl
+37
-0
src/main/plugin/iso19139.mcp-1.4/present/csw/own-summary.xsl
src/main/plugin/iso19139.mcp-1.4/present/csw/own-summary.xsl
+206
-0
src/main/plugin/iso19139.mcp-1.4/present/metadata-view.xsl
src/main/plugin/iso19139.mcp-1.4/present/metadata-view.xsl
+0
-130
src/main/plugin/iso19139.mcp-1.4/present/metadata.xsl
src/main/plugin/iso19139.mcp-1.4/present/metadata.xsl
+29
-2
src/main/plugin/iso19139.mcp-1.4/schema-ident.xml
src/main/plugin/iso19139.mcp-1.4/schema-ident.xml
+1
-1
src/main/plugin/iso19139.mcp-1.4/schematron/schematron-rules-iso-codeListValidation.xsl
....4/schematron/schematron-rules-iso-codeListValidation.xsl
+253
-0
src/main/plugin/iso19139.mcp-1.4/schematron/schematron-rules-iso-mcp.xsl
.../iso19139.mcp-1.4/schematron/schematron-rules-iso-mcp.xsl
+2058
-0
No files found.
src/main/plugin/iso19139.mcp-1.4/formatter/config.properties
0 → 100644
View file @
51f94730
#
# Copyright (C) 2001-2016 Food and Agriculture Organization of the
# United Nations (FAO-UN), United Nations World Food Programme (WFP)
# and United Nations Environment Programme (UNEP)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
#
# Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
# Rome - Italy. email: geonetwork@osgeo.org
#
schemasToLoad
=
iso19139.mcp-1.4
loadGeonetworkStrings
=
false
fixedLang
=
false
src/main/plugin/iso19139.mcp-1.4/formatter/full_view/view.groovy
0 → 100644
View file @
51f94730
/*
* Copyright (C) 2001-2016 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
* Rome - Italy. email: geonetwork@osgeo.org
*/
import
iso19139.SummaryFactory
def
isoHandlers
=
new
iso19139
.
Handlers
(
handlers
,
f
,
env
)
SummaryFactory
.
summaryHandler
({
it
.
parent
()
is
it
.
parent
()},
isoHandlers
)
isoHandlers
.
addDefaultHandlers
()
src/main/plugin/iso19139.mcp-1.4/formatter/groovy/iso19139/Functions.groovy
0 → 100644
View file @
51f94730
/*
* Copyright (C) 2001-2016 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
* Rome - Italy. email: geonetwork@osgeo.org
*/
package
iso19139
import
org.fao.geonet.domain.ISODate
import
java.text.SimpleDateFormat
public
class
Functions
{
static
final
def
CHAR_PATTERN
=
/\W/
def
handlers
;
def
f
def
env
common
.
Handlers
commonHandlers
def
clean
=
{
text
->
if
(
text
==
null
)
{
return
''
}
def
trimmed
=
text
.
trim
()
if
((
trimmed
=~
CHAR_PATTERN
).
matches
())
{
trimmed
=
''
;
}
return
trimmed
;
}
def
isoUrlText
=
{
el
->
el
.
'gmd:URL'
.
text
()
}
def
isoAnchorUrlLink
=
{
el
->
el
.
'gmx:Anchor'
[
'@xlink:href'
].
text
()
}
def
isoAnchorUrlText
=
{
el
->
el
.
'gmx:Anchor'
.
text
()
}
def
isoText
=
{
el
->
def
uiCode2
=
'#'
+
env
.
lang2
.
toUpperCase
()
def
uiCode3
=
'#'
+
env
.
lang3
.
toUpperCase
()
def
locStrings
=
el
.
'**'
.
findAll
{
it
.
name
()
==
'gmd:LocalisedCharacterString'
&&
!
it
.
text
().
isEmpty
()}
def
ptEl
=
locStrings
.
find
{(
it
.
'@locale'
==
uiCode2
||
it
.
'@locale'
==
uiCode3
)}
if
(
ptEl
!=
null
)
return
ptEl
.
text
()
def
charString
=
el
.
'**'
.
findAll
{
it
.
name
()
==
'gco:CharacterString'
&&
!
it
.
text
().
isEmpty
()}
if
(!
charString
.
isEmpty
())
return
charString
[
0
].
text
()
if
(!
locStrings
.
isEmpty
())
return
locStrings
[
0
].
text
()
""
}
def
dateText
=
{
el
->
String
date
=
el
.
'gco:Date'
.
text
()
String
dateTime
=
el
.
'gco:DateTime'
.
text
()
if
(!
date
.
isEmpty
())
{
return
date
;
}
else
if
(!
dateTime
.
isEmpty
()){
ISODate
isoDate
=
new
ISODate
(
dateTime
)
return
new
SimpleDateFormat
(
"dd-MM-yyyy HH:mm:ss"
).
format
(
isoDate
.
toDate
())
}
}
/**
* A shortcut for: commonHandlers.func.textEl(node), text))
* @return
*/
def
isoTextEl
(
node
,
text
)
{
return
commonHandlers
.
func
.
textEl
(
f
.
nodeLabel
(
node
),
text
)
}
/**
* A shortcut for: commonHandlers.func.wikiTextEl(node), text))
* @return
*/
def
isoWikiTextEl
(
node
,
text
)
{
return
commonHandlers
.
func
.
wikiTextEl
(
f
.
nodeLabel
(
node
),
text
)
}
/**
* A shortcut for: commonHandlers.func.textEl(node), text))
* @return
*/
def
isoUrlEl
(
node
,
href
,
text
)
{
return
commonHandlers
.
func
.
urlEl
(
f
.
nodeLabel
(
node
),
href
,
text
)
}
}
\ No newline at end of file
src/main/plugin/iso19139.mcp-1.4/formatter/groovy/iso19139/Handlers.groovy
0 → 100644
View file @
51f94730
This diff is collapsed.
Click to expand it.
src/main/plugin/iso19139.mcp-1.4/formatter/groovy/iso19139/Matchers.groovy
0 → 100644
View file @
51f94730
/*
* Copyright (C) 2001-2016 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
* Rome - Italy. email: geonetwork@osgeo.org
*/
package
iso19139
public
class
Matchers
{
def
handlers
;
def
f
def
env
def
isUrlEl
=
{!
it
.
'gmd:URL'
.
text
().
isEmpty
()}
def
isAnchorUrlEl
=
{!
it
.
'gmx:Anchor'
[
'@xlink:href'
].
text
().
isEmpty
()}
def
simpleElements
=
[
'gco:Decimal'
,
'gco:Integer'
,
'gco:Scale'
,
'gco:Angle'
,
'gco:Measure'
,
'gco:Distance'
,
'gmd:MD_PixelOrientationCode'
,
'gts:TM_PeriodDuration'
]
def
skipContainers
=
[
'gmd:CI_Series'
,
'gmd:MD_ReferenceSystem'
,
'gmd:identificationInfo'
,
'gmd:transferOptions'
,
'gmd:contactInfo'
,
'gmd:address'
,
'gmd:phone'
,
'gmd:onlineResource'
,
'gmd:referenceSystemIdentifier'
,
'gmd:distributorTransferOptions'
,
'gmd:resourceMaintenance'
,
'gmd:resourceConstraints'
,
'gmd:aggregationInfo'
,
'gmd:scope'
,
'gmd:DQ_DataQuality'
,
'gmd:lineage'
,
'gmd:processStep'
,
'gmd:MD_Distribution'
,
'gmd:MD_Distributor'
]
def
isBasicType
=
{
el
->
el
.
children
().
size
()
==
1
&&
simpleElements
.
any
{!
el
[
it
].
text
().
isEmpty
()}
}
def
isDateEl
=
{!
it
.
'gco:DateTime'
.
text
().
isEmpty
()
||
!
it
.
'gco:Date'
.
text
().
isEmpty
()}
def
isFormatEl
=
{!
it
.
'gmd:MD_Format'
.
text
().
isEmpty
()
||
(
it
.
name
()
==
'gmd:MD_Format'
&&
!
it
.
text
().
isEmpty
())}
def
isBooleanEl
=
{!
it
.
'gco:Boolean'
.
text
().
isEmpty
()}
def
hasDateChild
=
{
it
.
children
().
size
()
==
1
&&
it
.
children
().
any
(
isDateEl
)}
def
isCodeListEl
=
{!
it
[
'@codeListValue'
].
text
().
isEmpty
()}
def
hasCodeListChild
=
{
it
.
children
().
size
()
==
1
&&
it
.
children
().
any
(
isCodeListEl
)}
def
isTextEl
=
{
el
->
!
el
.
'gco:CharacterString'
.
text
().
isEmpty
()
||
!
el
.
'gmd:PT_FreeText'
.
'gmd:textGroup'
.
'gmd:LocalisedCharacterString'
.
text
().
isEmpty
()
}
def
isSimpleTextEl
=
{
el
->
el
.
children
().
isEmpty
()
&&
!
el
.
text
().
isEmpty
()
}
def
isContainerEl
=
{
el
->
!
isBasicType
(
el
)
&&
!
isSimpleTextEl
(
el
)
&&
!
isTextEl
(
el
)
&&
!
isUrlEl
(
el
)
&&
!
isAnchorUrlEl
(
el
)
&&
!
isCodeListEl
(
el
)
&&
!
hasCodeListChild
(
el
)
&&
!
isDateEl
(
el
)
&&
!
hasDateChild
(
el
)
&&
!
el
.
children
().
isEmpty
()
//!excludeContainer.any{it == el.name()}
}
def
isRespParty
=
{
el
->
!
el
.
'gmd:CI_ResponsibleParty'
.
isEmpty
()
||
el
.
'*'
[
'@gco:isoType'
].
text
()
==
'gmd:CI_ResponsibleParty'
}
def
isCiOnlineResourceParent
=
{
el
->
!
el
.
'gmd:CI_OnlineResource'
.
text
().
isEmpty
()
}
def
isBBox
=
{
el
->
el
.
name
()
==
'gmd:EX_GeographicBoundingBox'
}
def
isPolygon
=
{
el
->
el
.
name
()
==
'gmd:EX_BoundingPolygon'
}
def
isRoot
=
{
el
->
el
.
parent
()
is
el
}
def
isSkippedContainer
=
{
el
->
skipContainers
.
contains
(
el
.
name
())
}
}
src/main/plugin/iso19139.mcp-1.4/formatter/groovy/iso19139/SummaryFactory.groovy
0 → 100644
View file @
51f94730
/*
* Copyright (C) 2001-2016 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
* Rome - Italy. email: geonetwork@osgeo.org
*/
package
iso19139
import
org.fao.geonet.api.records.formatters.FormatType
import
org.fao.geonet.api.records.formatters.groovy.Environment
import
org.fao.geonet.api.records.formatters.groovy.util.*
import
java.util.regex.Pattern
/**
* Creates the {@link org.fao.geonet.api.records.formatters.groovy.util.Summary} instance for the iso19139 class.
*
* @author Jesse on 11/18/2014.
*/
class
SummaryFactory
{
def
isoHandlers
;
org
.
fao
.
geonet
.
api
.
records
.
formatters
.
groovy
.
Handlers
handlers
org
.
fao
.
geonet
.
api
.
records
.
formatters
.
groovy
.
Functions
f
Environment
env
def
navBarItems
/*
* This field can be set by the creator and provided a closure that will be passed the summary object. The closure can
* perform customization for its needs.
*/
Closure
<
Summary
>
summaryCustomizer
=
null
SummaryFactory
(
isoHandlers
,
summaryCustomizer
)
{
this
.
isoHandlers
=
isoHandlers
this
.
handlers
=
isoHandlers
.
handlers
;
this
.
f
=
isoHandlers
.
f
;
this
.
env
=
isoHandlers
.
env
;
this
.
navBarItems
=
[
'gmd:identificationInfo'
,
'gmd:distributionInfo'
,
isoHandlers
.
rootEl
]
this
.
summaryCustomizer
=
summaryCustomizer
;
}
SummaryFactory
(
isoHandlers
)
{
this
(
isoHandlers
,
null
)
}
static
void
summaryHandler
(
select
,
isoHandler
)
{
def
factory
=
new
SummaryFactory
(
isoHandler
)
factory
.
handlers
.
add
name:
"Summary Handler"
,
select:
select
,
{
factory
.
create
(
it
).
getResult
()}
}
Summary
create
(
metadata
)
{
Summary
summary
=
new
Summary
(
this
.
handlers
,
this
.
env
,
this
.
f
)
summary
.
title
=
this
.
isoHandlers
.
isofunc
.
isoText
(
metadata
.
'gmd:identificationInfo'
.
'*'
.
'gmd:citation'
.
'gmd:CI_Citation'
.
'gmd:title'
)
summary
.
abstr
=
this
.
isoHandlers
.
isofunc
.
isoText
(
metadata
.
'gmd:identificationInfo'
.
'*'
.
'gmd:abstract'
).
replaceAll
(
"\n"
,
"<br>"
)
configureKeywords
(
metadata
,
summary
)
configureFormats
(
metadata
,
summary
)
configureExtent
(
metadata
,
summary
)
configureThumbnails
(
metadata
,
summary
)
LinkBlock
linkBlock
=
new
LinkBlock
(
'links'
,
"fa fa-link"
);
configureLinks
(
linkBlock
,
'link'
,
false
,
{
def
linkParts
=
it
.
split
(
"\\|"
)
[
title
:
isoHandlers
.
isofunc
.
clean
(
linkParts
[
0
]),
desc
:
isoHandlers
.
isofunc
.
clean
(
linkParts
[
1
]),
href
:
isoHandlers
.
isofunc
.
clean
(
linkParts
[
2
]),
protocol:
isoHandlers
.
isofunc
.
clean
(
linkParts
[
3
])
]
})
if
(!
linkBlock
.
links
.
isEmpty
())
{
summary
.
links
.
add
(
linkBlock
)
}
/*
* TODO fix the xslt transform required by loadHierarchyLinkBlocks when running tests.
*/
if
(
env
.
formatType
==
FormatType
.
pdf
/* || env.formatType == FormatType.testpdf */
)
{
summary
.
associated
.
add
(
isoHandlers
.
commonHandlers
.
loadHierarchyLinkBlocks
())
}
else
{
summary
.
associated
.
add
(
createDynamicAssociatedHtml
(
summary
))
}
def
toNavBarItem
=
{
s
->
def
name
=
f
.
nodeLabel
(
s
,
null
)
def
abbrName
=
f
.
nodeTranslation
(
s
,
null
,
"abbrLabel"
)
new
NavBarItem
(
name
,
abbrName
,
'.'
+
s
.
replace
(
':'
,
"_"
))
}
summary
.
navBar
=
this
.
isoHandlers
.
packageViews
.
findAll
{
navBarItems
.
contains
(
it
)}.
collect
(
toNavBarItem
)
summary
.
navBarOverflow
=
this
.
isoHandlers
.
packageViews
.
findAll
{!
navBarItems
.
contains
(
it
)}.
collect
(
toNavBarItem
)
summary
.
navBarOverflow
.
add
(
isoHandlers
.
commonHandlers
.
createXmlNavBarItem
())
summary
.
content
=
this
.
isoHandlers
.
rootPackageEl
(
metadata
)
if
(
summaryCustomizer
!=
null
)
{
summaryCustomizer
(
summary
);
}
return
summary
}
def
configureKeywords
(
metadata
,
summary
)
{
def
keywords
=
metadata
.
"**"
.
findAll
{
it
.
name
()
==
'gmd:descriptiveKeywords'
}
if
(!
keywords
.
isEmpty
())
{
summary
.
keywords
=
this
.
isoHandlers
.
keywordsEl
(
keywords
).
toString
()
}
}
def
configureFormats
(
metadata
,
summary
)
{
def
formats
=
metadata
.
"**"
.
findAll
this
.
isoHandlers
.
matchers
.
isFormatEl
if
(!
formats
.
isEmpty
())
{
summary
.
formats
=
this
.
isoHandlers
.
formatEls
(
formats
).
toString
()
}
}
def
configureExtent
(
metadata
,
summary
)
{
def
extents
=
metadata
.
"**"
.
findAll
{
this
.
isoHandlers
.
matchers
.
isPolygon
(
it
)
||
this
.
isoHandlers
.
matchers
.
isBBox
(
it
)
}
def
split
=
extents
.
split
this
.
isoHandlers
.
matchers
.
isPolygon
def
polygons
=
split
[
0
]
def
bboxes
=
split
[
1
]
def
extent
=
""
if
(!
polygons
.
isEmpty
())
{
extent
=
this
.
isoHandlers
.
polygonEl
(
true
)(
polygons
[
0
]).
toString
()
}
else
if
(!
bboxes
.
isEmpty
())
{
extent
=
this
.
isoHandlers
.
bboxEl
(
true
)(
bboxes
[
0
]).
toString
()
}
summary
.
extent
=
extent
}
def
configureLinks
(
linkBlock
,
indexKey
,
urlAndTextEquals
,
objParser
)
{
Collection
<
String
>
links
=
this
.
env
.
indexInfo
[
indexKey
];
if
(
links
!=
null
&&
!
links
.
isEmpty
())
{
links
.
each
{
link
->
def
linkParts
=
objParser
(
link
)
def
title
=
linkParts
.
title
def
desc
=
linkParts
.
desc
def
href
=
linkParts
.
href
if
(
title
.
isEmpty
())
{
title
=
desc
;
}
if
(
title
.
isEmpty
())
{
title
=
href
;
}
if
(
href
!=
''
)
{
def
protocol
=
linkParts
.
protocol
!=
null
?
linkParts
.
protocol
.
toLowerCase
()
:
''
;
def
linkClass
=
href
.
isEmpty
()
?
'text-muted'
:
''
;
def
imagesDir
=
"../../images/formatter/"
def
type
;
def
icon
=
""
;
def
iconClasses
=
""
;
if
(
protocol
.
contains
(
"kml"
))
{
type
=
"kml"
;
icon
=
imagesDir
+
"kml.png"
;
}
else
if
(
protocol
.
contains
(
"wms"
))
{
type
=
"wms"
;
icon
=
imagesDir
+
"wms.png"
;
}
else
if
(
protocol
.
contains
(
"download"
))
{
type
=
"download"
;
iconClasses
=
"fa fa-download"
}
else
if
(
protocol
.
contains
(
"wfs"
))
{
type
=
"wfs"
;
icon
=
imagesDir
+
"wfs.png"
;
}
else
if
(
protocol
.
contains
(
"ogc:"
))
{
type
=
"ogc"
;
}
else
{
if
(
indexKey
==
'wms_uri'
)
{
type
=
"wms"
;
icon
=
imagesDir
+
"wms.png"
;
}
else
{
type
=
"link"
;
iconClasses
=
"fa fa-link"
}
}
def
linkType
=
new
LinkType
(
type
,
null
,
icon
,
iconClasses
)
def
linkObj
=
new
Link
(
href
,
title
,
linkClass
)
if
(
urlAndTextEquals
)
{
linkBlock
.
linkMap
.
put
(
linkType
,
linkObj
);
}
else
{
linkBlock
.
put
(
linkType
,
linkObj
)
}
}
}
}
}
LinkBlock
createDynamicAssociatedHtml
(
Summary
summary
)
{
def
associated
=
"associated-link"
def
html
=
"""
<script type="text/javascript">
//<![CDATA[
gnFormatter.loadAssociated(undefined, '.${LinkBlock.CSS_CLASS_PREFIX + associated}', '${this.env.metadataUUID}', undefined, '.associated-spinner')
//]]></script>
<div><i class="fa fa-circle-o-notch fa-spin pad-right associated-spinner"></i>Loading...</div>
"""
LinkBlock
linkBlock
=
new
LinkBlock
(
associated
,
"fa fa-sitemap"
)
linkBlock
.
html
=
html
return
linkBlock
;
}
private
static
void
configureThumbnails
(
metadata
,
header
)
{
def
logos
=
metadata
.
'gmd:identificationInfo'
.
'*'
.
'gmd:graphicOverview'
.
'gmd:MD_BrowseGraphic'
.
'gmd:fileName'
.
'gco:CharacterString'
logos
.
each
{
logo
->
header
.
addThumbnail
(
logo
.
text
())
}
}
}
src/main/plugin/iso19139.mcp-1.4/formatter/html/citation.html
0 → 100644
View file @
51f94730
<!--
~ Copyright (C) 2001-2016 Food and Agriculture Organization of the
~ United Nations (FAO-UN), United Nations World Food Programme (WFP)
~ and United Nations Environment Programme (UNEP)
~
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation; either version 2 of the License, or (at
~ your option) any later version.
~
~ This program is distributed in the hope that it will be useful, but
~ WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
~
~ Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
~ Rome - Italy. email: geonetwork@osgeo.org
-->
<div>
<div
class=
"row"
>
{{title}}
{{altTitle}}
{{date}}
{{editionInfo}}
</div>
<div
class=
"row"
>
{{identifier}}
{{presentationForm}}
{{ISBN}}
{{ISSN}}
</div>
<div>
{{otherData}}
</div>
</div>
src/main/plugin/iso19139.mcp-1.4/formatter/html/coupled-resources.html
0 → 100644
View file @
51f94730
<!--
~ Copyright (C) 2001-2016 Food and Agriculture Organization of the
~ United Nations (FAO-UN), United Nations World Food Programme (WFP)
~ and United Nations Environment Programme (UNEP)
~
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation; either version 2 of the License, or (at
~ your option) any later version.
~
~ This program is distributed in the hope that it will be useful, but
~ WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
~
~ Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
~ Rome - Italy. email: geonetwork@osgeo.org
-->
<div
fmt-transclude=
"html/2-level-entry.html"
fmt-transclude-model=
"childData"
>
<ul
class=
"container-list"
>
<li
fmt-repeat=
"(opName, links) in resources"
>
<strong>
{{opName}}
</strong>
<ul
class=
"md-value-list"
>
<li
fmt-repeat=
"link in links"
>
<span
fmt-include=
"html/single-resource.html"
fmt-include-replace=
"true"
/>
</li>
</ul>
</li>
</ul>
</div>
src/main/plugin/iso19139.mcp-1.4/formatter/html/format.html
0 → 100644
View file @
51f94730
<!--
~ Copyright (C) 2001-2016 Food and Agriculture Organization of the