Skip to content

Commit

Permalink
no parameter doc conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
jodygarnett committed Sep 21, 2023
1 parent f651c8d commit 7f0d43f
Show file tree
Hide file tree
Showing 18 changed files with 459 additions and 294 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
This file is produced automatically from the geonetwork-core repository. To make any suggestions to the content of the page please add your changes to [core-geonetwork/schemas/config.editor.xsd](https://github.com/geonetwork/core-geonetwork/blob/main/schemas/config-editor.xsd).


## Creating custom editor

A metadata editor configuration is defined for a specific schema plugin standard (see [implementing-a-schema-plugin](implementing-a-schema-plugin.md)).

The editor configuration defines the navigation menu for the editor (i.e. list of views and tabs), the list of fields and the type of control to use. Controls can be HTML-type (e.g. text, date) or more advanced controls built using [AngularJS directives](https://docs.angularjs.org/guide/directive).
Expand Down
10 changes: 5 additions & 5 deletions docs/manual/docs/maintainer-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

For installation instructions, please refer to the [installation](installation.md).

- [Installation](/install-guide)
- [Setup](/administrator-guide)
- [Setting up search/content statistics](statistics)
- [Production Use](production-use)
- [Updating the application](updating)
- [Installation](/install-guide/index.md)
- [Setup](/administrator-guide/index.md)
- [Setting up search/content statistics](statistics/index.md)
- [Production Use](production-use/index.md)
- [Updating the application](updating/index.md)
6 changes: 4 additions & 2 deletions docs/manual/docs/tutorials/customui/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Customize your GeoNetwork UI {#tuto-customui}

- [Search Index](search/index.md)
- [View Index](view/index.md)
- [Search](search/index.md)
- [View](view/index.md)

For editor customization see [creating-custom-editor](creating-custom-editor.md):.
278 changes: 142 additions & 136 deletions docs/manual/docs/tutorials/customui/view/formatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,18 @@

Go to <https://github.com/fgravin/core-geonetwork/commits/foss4g>

1. Create a new formatter - create a new folder named 'foss4g" in /schemas/iso19139/src/main/plugin/iso19139/formatter - create a new groovy file in this new folder - text information are stored in `gco:CharacterString`
1. Create a new formatter

- create a new folder named 'foss4g" in /schemas/iso19139/src/main/plugin/iso19139/formatter

- create a new groovy file in this new folder

- text information are stored in `gco:CharacterString`

``` groovy
handlers.add 'gco:CharacterString', {el -> "<div>${el.text()}</div>"}
```
``` groovy
handlers.add 'gco:CharacterString', {el -> "<div>${el.text()}</div>"}
```
2. Add a matcher and play with `name` and `text` properties.
``` groovy
Expand All @@ -39,181 +45,181 @@ Go to <https://github.com/fgravin/core-geonetwork/commits/foss4g>
3. Use `handlers.fileResult` function
- view.groovy
- view.groovy
``` groovy
handlers.add select: {el -> !el.'gco:CharacterString'.text().isEmpty()}, {el ->
handlers.fileResult('foss4g/elem.html', [name: el.name(), text: el.text()])
}
```
``` groovy
handlers.add select: {el -> !el.'gco:CharacterString'.text().isEmpty()}, {el ->
handlers.fileResult('foss4g/elem.html', [name: el.name(), text: el.text()])
}
```
- elem.html
- elem.html
``` html
<dl>
``` html
<dl>
<dt>{{name}}</dt>
<dd>{{text}}</dd>
</dl>
```
</dl>
```
4. Add a custom less file in wro4j inspected folders and link it to your formatter
- formatter.less
``` css
dt {
width: 230px;
font-weight: normal;
font-style: italic;
color: #555555;
clear: none;
padding-left: 15px;
text-align: left;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
float: left;
}
dd {
margin-left: 250px;
border-left: 1px solid #999999;
padding-left: 1em;
background: #eeeeee;
}
```
- formatter.less
``` css
dt {
width: 230px;
font-weight: normal;
font-style: italic;
color: #555555;
clear: none;
padding-left: 15px;
text-align: left;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
float: left;
}
- view.groovy
dd {
margin-left: 250px;
border-left: 1px solid #999999;
padding-left: 1em;
background: #eeeeee;
}
```
``` groovy
handlers.start {
'''<link rel="stylesheet" href="../../static/formatter.css"/>
<div class="container">'''
}
handlers.end {
'</div>'
}
- view.groovy
handlers.add select: {el -> !el.'gco:CharacterString'.text().isEmpty()}, {el ->
handlers.fileResult('foss4g/elem.html', [name: el.name(), text: el.text()])
}
```
``` groovy
handlers.start {
'''<link rel="stylesheet" href="../../static/formatter.css"/>
<div class="container">'''
}
handlers.end {
'</div>'
}
5. Use `fmt-repeat-only-children` in template and `prent()` function.
handlers.add select: {el -> !el.'gco:CharacterString'.text().isEmpty()}, {el ->
handlers.fileResult('foss4g/elem.html', [name: el.name(), text: el.text()])
}
```
- view.groovy
5. Use `fmt-repeat-only-children` in template and `prent()` function.
``` groovy
...
handlers.add select: {el -> !el.'gco:CharacterString'.text().isEmpty()},
group: true, {els ->
def elements = els.collect {el ->
[name: el.name(), text: el.text()]
}
handlers.fileResult('foss4g/elem.html',
[elements: elements, parent: els[0].parent().name()])
}
```
- view.groovy
``` groovy
...
handlers.add select: {el -> !el.'gco:CharacterString'.text().isEmpty()},
group: true, {els ->
def elements = els.collect {el ->
[name: el.name(), text: el.text()]
}
handlers.fileResult('foss4g/elem.html',
[elements: elements, parent: els[0].parent().name()])
}
```
- elem.html
- elem.html
``` html
<dl>
<h3>{{parent}}</h3>
<div fmt-repeat="el in elements" fmt-repeat-only-children="true">
<dt>{{el.name}}</dt>
<dd>{{el.text}}</dd>
</div>
</dl>
```
``` html
<dl>
<h3>{{parent}}</h3>
<div fmt-repeat="el in elements" fmt-repeat-only-children="true">
<dt>{{el.name}}</dt>
<dd>{{el.text}}</dd>
</div>
</dl>
```
6. See `nodeLabel` function
- view.groovy
``` groovy
...
handlers.add select: {el -> !el.'gco:CharacterString'.text().isEmpty()},
group: true, {els ->
def elements = els.collect {el ->
[name: f.nodeLabel(el), text: el.text()]
- view.groovy
``` groovy
...
handlers.add select: {el -> !el.'gco:CharacterString'.text().isEmpty()},
group: true, {els ->
def elements = els.collect {el ->
[name: f.nodeLabel(el), text: el.text()]
}
handlers.fileResult('foss4g/elem.html',
[elements: elements, parent: f.nodeLabel(els[0].parent())])
}
handlers.fileResult('foss4g/elem.html',
[elements: elements, parent: f.nodeLabel(els[0].parent())])
}
```
```
7. Add `gn-metadata-view` class to your container update your handler.
- view.groovy
- view.groovy
``` groovy
handlers.start {
'''<div class="gn-metadata-view container">'''
}
handlers.end {
'</div>'
}
``` groovy
handlers.start {
'''<div class="gn-metadata-view container">'''
}
handlers.end {
'</div>'
}
def isoHandlers = new iso19139.Handlers(handlers, f, env)
def isoHandlers = new iso19139.Handlers(handlers, f, env)
handlers.add select: isoHandlers.matchers.isTextEl, isoHandlers.isoTextEl
handlers.add name: 'Container Elements',
select: isoHandlers.matchers.isContainerEl,
priority: -1,
isoHandlers.commonHandlers.entryEl(f.&nodeLabel,
isoHandlers.addPackageViewClass)
isoHandlers.addExtentHandlers()
```
handlers.add select: isoHandlers.matchers.isTextEl, isoHandlers.isoTextEl
handlers.add name: 'Container Elements',
select: isoHandlers.matchers.isContainerEl,
priority: -1,
isoHandlers.commonHandlers.entryEl(f.&nodeLabel,
isoHandlers.addPackageViewClass)
isoHandlers.addExtentHandlers()
```
8. See `SummaryFactory` class.
- view.groovy
- view.groovy
``` groovy
import iso19139.SummaryFactory
``` groovy
import iso19139.SummaryFactory
def isoHandlers = new iso19139.Handlers(handlers, f, env)
def isoHandlers = new iso19139.Handlers(handlers, f, env)
SummaryFactory.summaryHandler({it.parent() is it.parent()}, isoHandlers)
SummaryFactory.summaryHandler({it.parent() is it.parent()}, isoHandlers)
isoHandlers.addDefaultHandlers()
```
isoHandlers.addDefaultHandlers()
```
9. Add custom option to the `SummaryFactory`
- view.groovy
- view.groovy
``` groovy
import iso19139.SummaryFactory
``` groovy
import iso19139.SummaryFactory
def isoHandlers = new iso19139.Handlers(handlers, f, env)
def isoHandlers = new iso19139.Handlers(handlers, f, env)
def factory = new SummaryFactory(isoHandlers, {summary ->
summary.title = "My Title"
summary.addCompleteNavItem = false
summary.addOverviewNavItem = false
summary.associated.clear()
})
def factory = new SummaryFactory(isoHandlers, {summary ->
summary.title = "My Title"
summary.addCompleteNavItem = false
summary.addOverviewNavItem = false
summary.associated.clear()
})
handlers.add name: "Summary Handler",
select: {it.parent() is it.parent()},
{factory.create(it).getResult()}
isoHandlers.addDefaultHandlers()
```
handlers.add name: "Summary Handler",
select: {it.parent() is it.parent()},
{factory.create(it).getResult()}
isoHandlers.addDefaultHandlers()
```
10. Add custom behavior to `iso19139.Handlers` constructor
- view.groovy
- view.groovy
``` groovy
def isoHandlers = new iso19139.Handlers(handlers, f, env) {
{
def oldImpl = super.isoTextEl
isoTextEl = { el ->
"----------- ${oldImpl(el)}"
``` groovy
def isoHandlers = new iso19139.Handlers(handlers, f, env) {
{
def oldImpl = super.isoTextEl
isoTextEl = { el ->
"----------- ${oldImpl(el)}"
}
}
}
}
```
```
12 changes: 7 additions & 5 deletions docs/manual/docs/tutorials/hookcustomizations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

At the end of this tutorial, you should be able to customize your own code into GeoNetwork on a clean and easy to upgrade way. You should start with the [tuto-introduction](tuto-introduction.md) tutorial first.

- [Newproject Index](newproject/index.md)
- [Events Index](events/index.md)
- [Ui Index](ui/index.md)
- [Schemaplugins Index](schemaplugins/index.md)
- [Searchfields Index](searchfields/index.md)
- [Newproject](newproject/index.md)
- [Events](events/index.md)
- [Ui](ui/index.md)
- [Schemaplugins](schemaplugins/index.md)
- [Searchfields](searchfields/index.md)

For ui customization see [tuto-customui](tuto-customui.md).
Loading

0 comments on commit 7f0d43f

Please sign in to comment.