[GeoNetwork-devel] geonetwork 3

Hi there,

When harvesting wfs from geoserver the results that are returned include entries for all formats available for a given layer.
While this is good for being able to access those links and services, on the results search pages the drop down that allows you to add layers to your map includes all results for a given layer.

Of those results only one layer can be added (normally the first layer) the other items cannot be loaded as they are links to access / download the layer in a specific format.

So in essence you have one layer that adds to your map and formats for the same layer that cannot be added.

Is there a way to filter the items in this list?

I have had a look at the code behind and i think i have drilled down to the function that loads the layer array results.
(forgive me if i have the wrong one as this is the first time i have looked at implementing Geonetwork)

In the Catalog default view folder ( catalog/default/view ) the module.js file contains the following function.
Which if i read it correctly loads a map layer to the map if it is not already there and can load all the layers in the list if wanted.

I believe this is populated by loading a layer and all its online resource link records.


$scope.resultviewFns = {
addMdLayerToMap: function (link, md) {

if (gnMap.isLayerInMap(viewerMap,
link.name, link.url)) {
return;
}
gnMap.addWmsFromScratch(viewerMap, link.url, link.name, false, md);
},
addAllMdLayersToMap: function (layers, md) {
angular.forEach(layers, function (layer) {
$scope.resultviewFns.addMdLayerToMap(layer, md);
});
},
loadMap: function (map, md) {
gnOwsContextService.loadContextFromUrl(map.url, viewerMap);
}
};

my question is this… can the array of results be filtered in some way to hide the results that are not able to be loaded onto the Map page?

Maybe by adding an extra option (check box) to the associated online resources you wish have available to add to the Map (Off by default)

Extra info:
The online resources in the capabilities xml includes the following <ows:Parameter name=“outputFormat”> and an associated online resource record is generated for each.

<ows:Parameter name=“outputFormat”>
ows:Valuetext/xml; subtype=gml/3.1.1</ows:Value>
ows:ValueDXF</ows:Value>
ows:ValueDXF-ZIP</ows:Value>
ows:ValueGML2</ows:Value>
ows:ValueKML</ows:Value>
ows:ValueSHAPE-ZIP</ows:Value>
ows:Valueapplication/gml+xml; version=3.2</ows:Value>
ows:Valueapplication/json</ows:Value>
ows:Valueapplication/vnd.google-earth.kml xml</ows:Value>
ows:Valueapplication/vnd.google-earth.kml+xml</ows:Value>
ows:Valuecsv</ows:Value>
ows:Valuegml3</ows:Value>
ows:Valuegml32</ows:Value>
ows:Valuejson</ows:Value>
ows:Valuetext/xml; subtype=gml/2.1.2</ows:Value>
ows:Valuetext/xml; subtype=gml/3.2</ows:Value>
</ows:Parameter>

Hi,

Did you harvest a WFS server or WMS ?
Then, is it the metadata of service that cause the problem, or the metadatas of dataset ?

The button is generated here
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/partials/viewtemplates/grid.html#L133

The array of layers is generated with
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/ResultsviewDirective.js#L169

This method will catch all links (online resources of the metadata) for which the procol contains OGC or kml.
You can just restricit the call here by using scope.layers = scope.md.getLinksByType(‘OGC:WMS’);.
Note that if you call for ‘OGC:WMS’ it will look for all links that the protocol contains the string, if you use ‘#OGC:WMS’, then it will check the protocol to equal the string.

···

On Wed, Jun 10, 2015 at 10:50 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi there,

When harvesting wfs from geoserver the results that are returned include entries for all formats available for a given layer.
While this is good for being able to access those links and services, on the results search pages the drop down that allows you to add layers to your map includes all results for a given layer.

Of those results only one layer can be added (normally the first layer) the other items cannot be loaded as they are links to access / download the layer in a specific format.

So in essence you have one layer that adds to your map and formats for the same layer that cannot be added.

Is there a way to filter the items in this list?

I have had a look at the code behind and i think i have drilled down to the function that loads the layer array results.
(forgive me if i have the wrong one as this is the first time i have looked at implementing Geonetwork)

In the Catalog default view folder ( catalog/default/view ) the module.js file contains the following function.
Which if i read it correctly loads a map layer to the map if it is not already there and can load all the layers in the list if wanted.

I believe this is populated by loading a layer and all its online resource link records.


$scope.resultviewFns = {
addMdLayerToMap: function (link, md) {

if (gnMap.isLayerInMap(viewerMap,
link.name, link.url)) {
return;
}
gnMap.addWmsFromScratch(viewerMap, link.url, link.name, false, md);
},
addAllMdLayersToMap: function (layers, md) {
angular.forEach(layers, function (layer) {
$scope.resultviewFns.addMdLayerToMap(layer, md);
});
},
loadMap: function (map, md) {
gnOwsContextService.loadContextFromUrl(map.url, viewerMap);
}
};

my question is this… can the array of results be filtered in some way to hide the results that are not able to be loaded onto the Map page?

Maybe by adding an extra option (check box) to the associated online resources you wish have available to add to the Map (Off by default)

Extra info:
The online resources in the capabilities xml includes the following <ows:Parameter name=“outputFormat”> and an associated online resource record is generated for each.

<ows:Parameter name=“outputFormat”>
ows:Valuetext/xml; subtype=gml/3.1.1</ows:Value>
ows:ValueDXF</ows:Value>
ows:ValueDXF-ZIP</ows:Value>
ows:ValueGML2</ows:Value>
ows:ValueKML</ows:Value>
ows:ValueSHAPE-ZIP</ows:Value>
ows:Valueapplication/gml+xml; version=3.2</ows:Value>
ows:Valueapplication/json</ows:Value>
ows:Valueapplication/vnd.google-earth.kml xml</ows:Value>
ows:Valueapplication/vnd.google-earth.kml+xml</ows:Value>
ows:Valuecsv</ows:Value>
ows:Valuegml3</ows:Value>
ows:Valuegml32</ows:Value>
ows:Valuejson</ows:Value>
ows:Valuetext/xml; subtype=gml/2.1.2</ows:Value>
ows:Valuetext/xml; subtype=gml/3.2</ows:Value>
</ows:Parameter>



GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Florent Gravin
Camptocamp - Chambéry
0479444492

Hi Florent,

If you are meaning the Protocol listed for the online resource within the
metadata record it is listed as OGC:WFS-1.0.0-http-get-feature

cheers

On Tue, Jun 23, 2015 at 10:49 PM, Florent Gravin <
florent.gravin@anonymised.com> wrote:

Hi,

Look at the gmd:online in the XML of your metadata, look the gmd:protocol
of each online resource and tell me what they are.
It's on those protocol that you should apply your filter.

On Tue, Jun 23, 2015 at 2:34 AM, Peter Van Dijk <upploadds@anonymised.com>
wrote:

Hi Florent,

Thank you for your feedback, sorry its taken awhile to get back to you,
very busy down here in NZ at the moment.

In this case i harvested WFS.
I have tested restricting the links as you have suggested and they are
still there.

Here is the altered code, which i have tested with scope true and scope
false as i was unsure if it needed to be changed to trigger the restriction.

I have also made sure that cached content is not be used and removed all
records and harvested again.

Any ideas what i should check next?

---------------------------------------------------------
module.directive('gnFixMdlinks', [
    function() {

      return {
        restrict: 'A',
        scope: true,
        link: function(scope) {
          //scope.links = scope.md.getLinksByType('LINK');
          //scope.downloads = scope.md.getLinksByType('DOWNLOAD');
          //scope.layers = scope.md.getLinksByType('OGC', 'kml');
  scope.layers = scope.md.getLinksByType('#OGC:WMS');
          //scope.maps = scope.md.getLinksByType('ows');
        }
      };
    }]);
--------------------------------------------------------

On Thu, Jun 11, 2015 at 8:31 PM, Florent Gravin <
florent.gravin@anonymised.com> wrote:

Hi,

Did you harvest a WFS server or WMS ?
Then, is it the metadata of service that cause the problem, or the
metadatas of dataset ?

The button is generated here

https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/partials/viewtemplates/grid.html#L133

The array of layers is generated with

https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/ResultsviewDirective.js#L169

This method will catch all links (online resources of the metadata) for
which the procol contains OGC or kml.
You can just restricit the call here by using scope.layers =
scope.md.getLinksByType('OGC:WMS');.
Note that if you call for 'OGC:WMS' it will look for all links that the
protocol contains the string, if you use '#OGC:WMS', then it will check the
protocol to equal the string.

On Wed, Jun 10, 2015 at 10:50 PM, Peter Van Dijk <upploadds@anonymised.com>
wrote:

Hi there,

When harvesting wfs from geoserver the results that are returned
include entries for all formats available for a given layer.
While this is good for being able to access those links and services,
on the results search pages the drop down that allows you to add layers to
your map includes all results for a given layer.

Of those results only one layer can be added (normally the first
layer) the other items cannot be loaded as they are links to access /
download the layer in a specific format.

So in essence you have one layer that adds to your map and formats for
the same layer that cannot be added.

Is there a way to filter the items in this list?

I have had a look at the code behind and i think i have drilled down
to the function that loads the layer array results.
(forgive me if i have the wrong one as this is the first time i have
looked at implementing Geonetwork)

In the Catalog default view folder ( catalog/default/view ) the
module.js file contains the following function.
Which if i read it correctly loads a map layer to the map if it is not
already there and can load all the layers in the list if wanted.
--
I believe this is populated by loading a layer and all its online
resource link records.

-------------------------------------------------------------------------------------------------------------------------------
$scope.resultviewFns = {
        addMdLayerToMap: function (link, md) {

          if (gnMap.isLayerInMap(viewerMap,
              link.name, link.url)) {
            return;
          }
          gnMap.addWmsFromScratch(viewerMap, link.url, link.name,
false, md);
      },
        addAllMdLayersToMap: function (layers, md) {
          angular.forEach(layers, function (layer) {
            $scope.resultviewFns.addMdLayerToMap(layer, md);
          });
        },
        loadMap: function (map, md) {
          gnOwsContextService.loadContextFromUrl(map.url, viewerMap);
        }
      };

-------------------------------------------------------------------------------------------------------------------------------

my question is this... can the array of results be filtered in some
way to hide the results that are not able to be loaded onto the Map page?

Maybe by adding an extra option (check box) to the associated online
resources you wish have available to add to the Map (Off by default)

Extra info:
The online resources in the capabilities xml includes the following
<ows:Parameter name="outputFormat"> and an associated online resource
record is generated for each.

<ows:Parameter name="outputFormat">
<ows:Value>text/xml; subtype=gml/3.1.1</ows:Value>
<ows:Value>DXF</ows:Value>
<ows:Value>DXF-ZIP</ows:Value>
<ows:Value>GML2</ows:Value>
<ows:Value>KML</ows:Value>
<ows:Value>SHAPE-ZIP</ows:Value>
<ows:Value>application/gml+xml; version=3.2</ows:Value>
<ows:Value>application/json</ows:Value>
<ows:Value>application/vnd.google-earth.kml xml</ows:Value>
<ows:Value>application/vnd.google-earth.kml+xml</ows:Value>
<ows:Value>csv</ows:Value>
<ows:Value>gml3</ows:Value>
<ows:Value>gml32</ows:Value>
<ows:Value>json</ows:Value>
<ows:Value>text/xml; subtype=gml/2.1.2</ows:Value>
<ows:Value>text/xml; subtype=gml/3.2</ows:Value>
</ows:Parameter>

------------------------------------------------------------------------------

_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at
http://sourceforge.net/projects/geonetwork

--
Florent Gravin
Camptocamp - Chambéry
0479444492

--
Florent Gravin
Camptocamp - Chambéry
0479444492

Hi,

Sorry i’m a bit lost with your issue, to sump up, you have only one online resource, it has protocol OGC:WFS-1.0.0-http-get-feature, but, in the mosaic result list, the globe button to add to the map has many values in the dropown ?

···

On Fri, Jun 26, 2015 at 3:58 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,
If you are meaning the Protocol listed for the online resource within the metadata record it is listed as OGC:WFS-1.0.0-http-get-feature

cheers

On Tue, Jun 23, 2015 at 10:49 PM, Florent Gravin <florent.gravin@anonymised.com.> wrote:

Hi,

Look at the gmd:online in the XML of your metadata, look the gmd:protocol of each online resource and tell me what they are.
It’s on those protocol that you should apply your filter.

On Tue, Jun 23, 2015 at 2:34 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,

Thank you for your feedback, sorry its taken awhile to get back to you, very busy down here in NZ at the moment.

In this case i harvested WFS.
I have tested restricting the links as you have suggested and they are still there.

Here is the altered code, which i have tested with scope true and scope false as i was unsure if it needed to be changed to trigger the restriction.

I have also made sure that cached content is not be used and removed all records and harvested again.

Any ideas what i should check next?


module.directive(‘gnFixMdlinks’, [

function() {

return {
restrict: ‘A’,
scope: true,
link: function(scope) {
//scope.links = scope.md.getLinksByType(‘LINK’);
//scope.downloads = scope.md.getLinksByType(‘DOWNLOAD’);
//scope.layers = scope.md.getLinksByType(‘OGC’, ‘kml’);
scope.layers = scope.md.getLinksByType(‘#OGC:WMS’);
//scope.maps = scope.md.getLinksByType(‘ows’);
}
};
}]);


Florent Gravin
Camptocamp - Chambéry
0479444492

On Thu, Jun 11, 2015 at 8:31 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Did you harvest a WFS server or WMS ?
Then, is it the metadata of service that cause the problem, or the metadatas of dataset ?

The button is generated here
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/partials/viewtemplates/grid.html#L133

The array of layers is generated with
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/ResultsviewDirective.js#L169

This method will catch all links (online resources of the metadata) for which the procol contains OGC or kml.
You can just restricit the call here by using scope.layers = scope.md.getLinksByType(‘OGC:WMS’);.
Note that if you call for ‘OGC:WMS’ it will look for all links that the protocol contains the string, if you use ‘#OGC:WMS’, then it will check the protocol to equal the string.

On Wed, Jun 10, 2015 at 10:50 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi there,

When harvesting wfs from geoserver the results that are returned include entries for all formats available for a given layer.
While this is good for being able to access those links and services, on the results search pages the drop down that allows you to add layers to your map includes all results for a given layer.

Of those results only one layer can be added (normally the first layer) the other items cannot be loaded as they are links to access / download the layer in a specific format.

So in essence you have one layer that adds to your map and formats for the same layer that cannot be added.

Is there a way to filter the items in this list?

I have had a look at the code behind and i think i have drilled down to the function that loads the layer array results.
(forgive me if i have the wrong one as this is the first time i have looked at implementing Geonetwork)

In the Catalog default view folder ( catalog/default/view ) the module.js file contains the following function.
Which if i read it correctly loads a map layer to the map if it is not already there and can load all the layers in the list if wanted.

I believe this is populated by loading a layer and all its online resource link records.


$scope.resultviewFns = {
addMdLayerToMap: function (link, md) {

if (gnMap.isLayerInMap(viewerMap,
link.name, link.url)) {
return;
}
gnMap.addWmsFromScratch(viewerMap, link.url, link.name, false, md);
},
addAllMdLayersToMap: function (layers, md) {
angular.forEach(layers, function (layer) {
$scope.resultviewFns.addMdLayerToMap(layer, md);
});
},
loadMap: function (map, md) {
gnOwsContextService.loadContextFromUrl(map.url, viewerMap);
}
};

my question is this… can the array of results be filtered in some way to hide the results that are not able to be loaded onto the Map page?

Maybe by adding an extra option (check box) to the associated online resources you wish have available to add to the Map (Off by default)

Extra info:
The online resources in the capabilities xml includes the following <ows:Parameter name=“outputFormat”> and an associated online resource record is generated for each.

<ows:Parameter name=“outputFormat”>
ows:Valuetext/xml; subtype=gml/3.1.1</ows:Value>
ows:ValueDXF</ows:Value>
ows:ValueDXF-ZIP</ows:Value>
ows:ValueGML2</ows:Value>
ows:ValueKML</ows:Value>
ows:ValueSHAPE-ZIP</ows:Value>
ows:Valueapplication/gml+xml; version=3.2</ows:Value>
ows:Valueapplication/json</ows:Value>
ows:Valueapplication/vnd.google-earth.kml xml</ows:Value>
ows:Valueapplication/vnd.google-earth.kml+xml</ows:Value>
ows:Valuecsv</ows:Value>
ows:Valuegml3</ows:Value>
ows:Valuegml32</ows:Value>
ows:Valuejson</ows:Value>
ows:Valuetext/xml; subtype=gml/2.1.2</ows:Value>
ows:Valuetext/xml; subtype=gml/3.2</ows:Value>
</ows:Parameter>



GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Florent Gravin
Camptocamp - Chambéry
0479444492

Florent Gravin
Camptocamp - Chambéry
0479444492

Hi florent,

Nearly, when you harvest a WFS (in my case geoserver), you end up with the following.
For each layer / resource available in the WFS get capabilities request you end up with a record for the layer.
Attached to each record are the online resource records that describe the formats that each layer is available to download in.

When you edit the record for the layer, each of the attached online resource records have the protocol OGC:WFS-1.0.0-http-get-feature

The online resource records for each WFS layer are the records that I wish to remove / filter from the add to map button list.

For clarification i can attach screen shots if you wish?

cheers

Peter Van Dijk

···

On Fri, Jun 26, 2015 at 8:44 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Sorry i’m a bit lost with your issue, to sump up, you have only one online resource, it has protocol OGC:WFS-1.0.0-http-get-feature, but, in the mosaic result list, the globe button to add to the map has many values in the dropown ?

On Fri, Jun 26, 2015 at 3:58 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Florent Gravin
Camptocamp - Chambéry
0479444492

Hi Florent,
If you are meaning the Protocol listed for the online resource within the metadata record it is listed as OGC:WFS-1.0.0-http-get-feature

cheers

On Tue, Jun 23, 2015 at 10:49 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Look at the gmd:online in the XML of your metadata, look the gmd:protocol of each online resource and tell me what they are.
It’s on those protocol that you should apply your filter.

On Tue, Jun 23, 2015 at 2:34 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,

Thank you for your feedback, sorry its taken awhile to get back to you, very busy down here in NZ at the moment.

In this case i harvested WFS.
I have tested restricting the links as you have suggested and they are still there.

Here is the altered code, which i have tested with scope true and scope false as i was unsure if it needed to be changed to trigger the restriction.

I have also made sure that cached content is not be used and removed all records and harvested again.

Any ideas what i should check next?


module.directive(‘gnFixMdlinks’, [

function() {

return {
restrict: ‘A’,
scope: true,
link: function(scope) {
//scope.links = scope.md.getLinksByType(‘LINK’);
//scope.downloads = scope.md.getLinksByType(‘DOWNLOAD’);
//scope.layers = scope.md.getLinksByType(‘OGC’, ‘kml’);
scope.layers = scope.md.getLinksByType(‘#OGC:WMS’);
//scope.maps = scope.md.getLinksByType(‘ows’);
}
};
}]);


Florent Gravin
Camptocamp - Chambéry
0479444492

On Thu, Jun 11, 2015 at 8:31 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Did you harvest a WFS server or WMS ?
Then, is it the metadata of service that cause the problem, or the metadatas of dataset ?

The button is generated here
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/partials/viewtemplates/grid.html#L133

The array of layers is generated with
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/ResultsviewDirective.js#L169

This method will catch all links (online resources of the metadata) for which the procol contains OGC or kml.
You can just restricit the call here by using scope.layers = scope.md.getLinksByType(‘OGC:WMS’);.
Note that if you call for ‘OGC:WMS’ it will look for all links that the protocol contains the string, if you use ‘#OGC:WMS’, then it will check the protocol to equal the string.

On Wed, Jun 10, 2015 at 10:50 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi there,

When harvesting wfs from geoserver the results that are returned include entries for all formats available for a given layer.
While this is good for being able to access those links and services, on the results search pages the drop down that allows you to add layers to your map includes all results for a given layer.

Of those results only one layer can be added (normally the first layer) the other items cannot be loaded as they are links to access / download the layer in a specific format.

So in essence you have one layer that adds to your map and formats for the same layer that cannot be added.

Is there a way to filter the items in this list?

I have had a look at the code behind and i think i have drilled down to the function that loads the layer array results.
(forgive me if i have the wrong one as this is the first time i have looked at implementing Geonetwork)

In the Catalog default view folder ( catalog/default/view ) the module.js file contains the following function.
Which if i read it correctly loads a map layer to the map if it is not already there and can load all the layers in the list if wanted.

I believe this is populated by loading a layer and all its online resource link records.


$scope.resultviewFns = {
addMdLayerToMap: function (link, md) {

if (gnMap.isLayerInMap(viewerMap,
link.name, link.url)) {
return;
}
gnMap.addWmsFromScratch(viewerMap, link.url, link.name, false, md);
},
addAllMdLayersToMap: function (layers, md) {
angular.forEach(layers, function (layer) {
$scope.resultviewFns.addMdLayerToMap(layer, md);
});
},
loadMap: function (map, md) {
gnOwsContextService.loadContextFromUrl(map.url, viewerMap);
}
};

my question is this… can the array of results be filtered in some way to hide the results that are not able to be loaded onto the Map page?

Maybe by adding an extra option (check box) to the associated online resources you wish have available to add to the Map (Off by default)

Extra info:
The online resources in the capabilities xml includes the following <ows:Parameter name=“outputFormat”> and an associated online resource record is generated for each.

<ows:Parameter name=“outputFormat”>
ows:Valuetext/xml; subtype=gml/3.1.1</ows:Value>
ows:ValueDXF</ows:Value>
ows:ValueDXF-ZIP</ows:Value>
ows:ValueGML2</ows:Value>
ows:ValueKML</ows:Value>
ows:ValueSHAPE-ZIP</ows:Value>
ows:Valueapplication/gml+xml; version=3.2</ows:Value>
ows:Valueapplication/json</ows:Value>
ows:Valueapplication/vnd.google-earth.kml xml</ows:Value>
ows:Valueapplication/vnd.google-earth.kml+xml</ows:Value>
ows:Valuecsv</ows:Value>
ows:Valuegml3</ows:Value>
ows:Valuegml32</ows:Value>
ows:Valuejson</ows:Value>
ows:Valuetext/xml; subtype=gml/2.1.2</ows:Value>
ows:Valuetext/xml; subtype=gml/3.2</ows:Value>
</ows:Parameter>



GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Florent Gravin
Camptocamp - Chambéry
0479444492

Hi Florent,
Here are the Geonetwork screen shots as requested.








···

On Tue, Jun 30, 2015 at 1:21 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,
Here are the screenshots as discussed.

cheers

On Mon, Jun 29, 2015 at 9:03 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Yes please, send a screen shot

On Sat, Jun 27, 2015 at 2:08 AM, Peter Van Dijk <upploadds@anonymised.com31…> wrote:

Hi florent,

Nearly, when you harvest a WFS (in my case geoserver), you end up with the following.
For each layer / resource available in the WFS get capabilities request you end up with a record for the layer.
Attached to each record are the online resource records that describe the formats that each layer is available to download in.

When you edit the record for the layer, each of the attached online resource records have the protocol OGC:WFS-1.0.0-http-get-feature

The online resource records for each WFS layer are the records that I wish to remove / filter from the add to map button list.

For clarification i can attach screen shots if you wish?

cheers

Peter Van Dijk

Florent Gravin
Camptocamp - Chambéry
0479444492

On Fri, Jun 26, 2015 at 8:44 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Sorry i’m a bit lost with your issue, to sump up, you have only one online resource, it has protocol OGC:WFS-1.0.0-http-get-feature, but, in the mosaic result list, the globe button to add to the map has many values in the dropown ?

On Fri, Jun 26, 2015 at 3:58 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Florent Gravin
Camptocamp - Chambéry
0479444492

Hi Florent,
If you are meaning the Protocol listed for the online resource within the metadata record it is listed as OGC:WFS-1.0.0-http-get-feature

cheers

On Tue, Jun 23, 2015 at 10:49 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Look at the gmd:online in the XML of your metadata, look the gmd:protocol of each online resource and tell me what they are.
It’s on those protocol that you should apply your filter.

On Tue, Jun 23, 2015 at 2:34 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,

Thank you for your feedback, sorry its taken awhile to get back to you, very busy down here in NZ at the moment.

In this case i harvested WFS.
I have tested restricting the links as you have suggested and they are still there.

Here is the altered code, which i have tested with scope true and scope false as i was unsure if it needed to be changed to trigger the restriction.

I have also made sure that cached content is not be used and removed all records and harvested again.

Any ideas what i should check next?


module.directive(‘gnFixMdlinks’, [

function() {

return {
restrict: ‘A’,
scope: true,
link: function(scope) {
//scope.links = scope.md.getLinksByType(‘LINK’);
//scope.downloads = scope.md.getLinksByType(‘DOWNLOAD’);
//scope.layers = scope.md.getLinksByType(‘OGC’, ‘kml’);
scope.layers = scope.md.getLinksByType(‘#OGC:WMS’);
//scope.maps = scope.md.getLinksByType(‘ows’);
}
};
}]);


Florent Gravin
Camptocamp - Chambéry
0479444492

On Thu, Jun 11, 2015 at 8:31 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Did you harvest a WFS server or WMS ?
Then, is it the metadata of service that cause the problem, or the metadatas of dataset ?

The button is generated here
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/partials/viewtemplates/grid.html#L133

The array of layers is generated with
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/ResultsviewDirective.js#L169

This method will catch all links (online resources of the metadata) for which the procol contains OGC or kml.
You can just restricit the call here by using scope.layers = scope.md.getLinksByType(‘OGC:WMS’);.
Note that if you call for ‘OGC:WMS’ it will look for all links that the protocol contains the string, if you use ‘#OGC:WMS’, then it will check the protocol to equal the string.

On Wed, Jun 10, 2015 at 10:50 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi there,

When harvesting wfs from geoserver the results that are returned include entries for all formats available for a given layer.
While this is good for being able to access those links and services, on the results search pages the drop down that allows you to add layers to your map includes all results for a given layer.

Of those results only one layer can be added (normally the first layer) the other items cannot be loaded as they are links to access / download the layer in a specific format.

So in essence you have one layer that adds to your map and formats for the same layer that cannot be added.

Is there a way to filter the items in this list?

I have had a look at the code behind and i think i have drilled down to the function that loads the layer array results.
(forgive me if i have the wrong one as this is the first time i have looked at implementing Geonetwork)

In the Catalog default view folder ( catalog/default/view ) the module.js file contains the following function.
Which if i read it correctly loads a map layer to the map if it is not already there and can load all the layers in the list if wanted.

I believe this is populated by loading a layer and all its online resource link records.


$scope.resultviewFns = {
addMdLayerToMap: function (link, md) {

if (gnMap.isLayerInMap(viewerMap,
link.name, link.url)) {
return;
}
gnMap.addWmsFromScratch(viewerMap, link.url, link.name, false, md);
},
addAllMdLayersToMap: function (layers, md) {
angular.forEach(layers, function (layer) {
$scope.resultviewFns.addMdLayerToMap(layer, md);
});
},
loadMap: function (map, md) {
gnOwsContextService.loadContextFromUrl(map.url, viewerMap);
}
};

my question is this… can the array of results be filtered in some way to hide the results that are not able to be loaded onto the Map page?

Maybe by adding an extra option (check box) to the associated online resources you wish have available to add to the Map (Off by default)

Extra info:
The online resources in the capabilities xml includes the following <ows:Parameter name=“outputFormat”> and an associated online resource record is generated for each.

<ows:Parameter name=“outputFormat”>
ows:Valuetext/xml; subtype=gml/3.1.1</ows:Value>
ows:ValueDXF</ows:Value>
ows:ValueDXF-ZIP</ows:Value>
ows:ValueGML2</ows:Value>
ows:ValueKML</ows:Value>
ows:ValueSHAPE-ZIP</ows:Value>
ows:Valueapplication/gml+xml; version=3.2</ows:Value>
ows:Valueapplication/json</ows:Value>
ows:Valueapplication/vnd.google-earth.kml xml</ows:Value>
ows:Valueapplication/vnd.google-earth.kml+xml</ows:Value>
ows:Valuecsv</ows:Value>
ows:Valuegml3</ows:Value>
ows:Valuegml32</ows:Value>
ows:Valuejson</ows:Value>
ows:Valuetext/xml; subtype=gml/2.1.2</ows:Value>
ows:Valuetext/xml; subtype=gml/3.2</ows:Value>
</ows:Parameter>



GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Florent Gravin
Camptocamp - Chambéry
0479444492

Hi,

Ok, first, are you running your geonetwork with jetty or tomcat ?
If you changed the line scope.layers = scope.md.getLinksByType(‘OGC:WMS’);.
Then you need to run your search page in debug mode to see the change:
srv/eng/catalog.search?debug, cause in env-prod profile, the wro4j doesn’t compile javascript on change.

You should see your change in the search result list.
In the metadataview (4th screenshot), it’s managed in a different place, it’s a bit more complex to change the behavior.
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/metadataactions/MetadataActionsDirective.js

(attachments)








···

On Tue, Jun 30, 2015 at 3:31 AM, Peter Van Dijk <upploadds@anonymised.com…> wrote:

Hi Florent,
Here are the Geonetwork screen shots as requested.








On Tue, Jun 30, 2015 at 1:21 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,
Here are the screenshots as discussed.

cheers

On Mon, Jun 29, 2015 at 9:03 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Yes please, send a screen shot

On Sat, Jun 27, 2015 at 2:08 AM, Peter Van Dijk <upploadds@anonymised.com.> wrote:

Hi florent,

Nearly, when you harvest a WFS (in my case geoserver), you end up with the following.
For each layer / resource available in the WFS get capabilities request you end up with a record for the layer.
Attached to each record are the online resource records that describe the formats that each layer is available to download in.

When you edit the record for the layer, each of the attached online resource records have the protocol OGC:WFS-1.0.0-http-get-feature

The online resource records for each WFS layer are the records that I wish to remove / filter from the add to map button list.

For clarification i can attach screen shots if you wish?

cheers

Peter Van Dijk

Florent Gravin
Camptocamp - Chambéry
0479444492

On Fri, Jun 26, 2015 at 8:44 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Sorry i’m a bit lost with your issue, to sump up, you have only one online resource, it has protocol OGC:WFS-1.0.0-http-get-feature, but, in the mosaic result list, the globe button to add to the map has many values in the dropown ?

On Fri, Jun 26, 2015 at 3:58 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Florent Gravin
Camptocamp - Chambéry
0479444492

Hi Florent,
If you are meaning the Protocol listed for the online resource within the metadata record it is listed as OGC:WFS-1.0.0-http-get-feature

cheers

On Tue, Jun 23, 2015 at 10:49 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Look at the gmd:online in the XML of your metadata, look the gmd:protocol of each online resource and tell me what they are.
It’s on those protocol that you should apply your filter.

On Tue, Jun 23, 2015 at 2:34 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,

Thank you for your feedback, sorry its taken awhile to get back to you, very busy down here in NZ at the moment.

In this case i harvested WFS.
I have tested restricting the links as you have suggested and they are still there.

Here is the altered code, which i have tested with scope true and scope false as i was unsure if it needed to be changed to trigger the restriction.

I have also made sure that cached content is not be used and removed all records and harvested again.

Any ideas what i should check next?


module.directive(‘gnFixMdlinks’, [

function() {

return {
restrict: ‘A’,
scope: true,
link: function(scope) {
//scope.links = scope.md.getLinksByType(‘LINK’);
//scope.downloads = scope.md.getLinksByType(‘DOWNLOAD’);
//scope.layers = scope.md.getLinksByType(‘OGC’, ‘kml’);
scope.layers = scope.md.getLinksByType(‘#OGC:WMS’);
//scope.maps = scope.md.getLinksByType(‘ows’);
}
};
}]);


Florent Gravin
Camptocamp - Chambéry
0479444492

On Thu, Jun 11, 2015 at 8:31 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Did you harvest a WFS server or WMS ?
Then, is it the metadata of service that cause the problem, or the metadatas of dataset ?

The button is generated here
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/partials/viewtemplates/grid.html#L133

The array of layers is generated with
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/ResultsviewDirective.js#L169

This method will catch all links (online resources of the metadata) for which the procol contains OGC or kml.
You can just restricit the call here by using scope.layers = scope.md.getLinksByType(‘OGC:WMS’);.
Note that if you call for ‘OGC:WMS’ it will look for all links that the protocol contains the string, if you use ‘#OGC:WMS’, then it will check the protocol to equal the string.

On Wed, Jun 10, 2015 at 10:50 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi there,

When harvesting wfs from geoserver the results that are returned include entries for all formats available for a given layer.
While this is good for being able to access those links and services, on the results search pages the drop down that allows you to add layers to your map includes all results for a given layer.

Of those results only one layer can be added (normally the first layer) the other items cannot be loaded as they are links to access / download the layer in a specific format.

So in essence you have one layer that adds to your map and formats for the same layer that cannot be added.

Is there a way to filter the items in this list?

I have had a look at the code behind and i think i have drilled down to the function that loads the layer array results.
(forgive me if i have the wrong one as this is the first time i have looked at implementing Geonetwork)

In the Catalog default view folder ( catalog/default/view ) the module.js file contains the following function.
Which if i read it correctly loads a map layer to the map if it is not already there and can load all the layers in the list if wanted.

I believe this is populated by loading a layer and all its online resource link records.


$scope.resultviewFns = {
addMdLayerToMap: function (link, md) {

if (gnMap.isLayerInMap(viewerMap,
link.name, link.url)) {
return;
}
gnMap.addWmsFromScratch(viewerMap, link.url, link.name, false, md);
},
addAllMdLayersToMap: function (layers, md) {
angular.forEach(layers, function (layer) {
$scope.resultviewFns.addMdLayerToMap(layer, md);
});
},
loadMap: function (map, md) {
gnOwsContextService.loadContextFromUrl(map.url, viewerMap);
}
};

my question is this… can the array of results be filtered in some way to hide the results that are not able to be loaded onto the Map page?

Maybe by adding an extra option (check box) to the associated online resources you wish have available to add to the Map (Off by default)

Extra info:
The online resources in the capabilities xml includes the following <ows:Parameter name=“outputFormat”> and an associated online resource record is generated for each.

<ows:Parameter name=“outputFormat”>
ows:Valuetext/xml; subtype=gml/3.1.1</ows:Value>
ows:ValueDXF</ows:Value>
ows:ValueDXF-ZIP</ows:Value>
ows:ValueGML2</ows:Value>
ows:ValueKML</ows:Value>
ows:ValueSHAPE-ZIP</ows:Value>
ows:Valueapplication/gml+xml; version=3.2</ows:Value>
ows:Valueapplication/json</ows:Value>
ows:Valueapplication/vnd.google-earth.kml xml</ows:Value>
ows:Valueapplication/vnd.google-earth.kml+xml</ows:Value>
ows:Valuecsv</ows:Value>
ows:Valuegml3</ows:Value>
ows:Valuegml32</ows:Value>
ows:Valuejson</ows:Value>
ows:Valuetext/xml; subtype=gml/2.1.2</ows:Value>
ows:Valuetext/xml; subtype=gml/3.2</ows:Value>
</ows:Parameter>



GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Florent Gravin
Camptocamp - Chambéry
0479444492

Florent Gravin
Camptocamp - Chambéry
0479444492

Hi Florent,
Running in tomcat 8 with the web app deployed from war. I’ll test out the change again in debug mode as you have suggested.

I’ve heard tomcat likes to hold onto cached code so will investigate this side of things as well.

Cheers
Peter

(attachments)

ADCGeoNetwrk_0630_006.png
ADCGeoNetwrk_0630_008.png
ADCGeoNetwrk_0630_004.png
ADCGeoNetwrk_0630_002.png
ADCGeoNetwrk_0630_001.png
ADCGeoNetwrk_0630_007.png
ADCGeoNetwrk_0630_003.png
ADCGeoNetwrk_0630_005.png

···

On Tue, Jun 30, 2015 at 3:31 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,
Here are the Geonetwork screen shots as requested.








On Tue, Jun 30, 2015 at 1:21 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,
Here are the screenshots as discussed.

cheers

On Mon, Jun 29, 2015 at 9:03 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Yes please, send a screen shot

On Sat, Jun 27, 2015 at 2:08 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi florent,

Nearly, when you harvest a WFS (in my case geoserver), you end up with the following.
For each layer / resource available in the WFS get capabilities request you end up with a record for the layer.
Attached to each record are the online resource records that describe the formats that each layer is available to download in.

When you edit the record for the layer, each of the attached online resource records have the protocol OGC:WFS-1.0.0-http-get-feature

The online resource records for each WFS layer are the records that I wish to remove / filter from the add to map button list.

For clarification i can attach screen shots if you wish?

cheers

Peter Van Dijk

Florent Gravin
Camptocamp - Chambéry
0479444492

On Fri, Jun 26, 2015 at 8:44 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Sorry i’m a bit lost with your issue, to sump up, you have only one online resource, it has protocol OGC:WFS-1.0.0-http-get-feature, but, in the mosaic result list, the globe button to add to the map has many values in the dropown ?

On Fri, Jun 26, 2015 at 3:58 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Florent Gravin
Camptocamp - Chambéry
0479444492

Hi Florent,
If you are meaning the Protocol listed for the online resource within the metadata record it is listed as OGC:WFS-1.0.0-http-get-feature

cheers

On Tue, Jun 23, 2015 at 10:49 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Look at the gmd:online in the XML of your metadata, look the gmd:protocol of each online resource and tell me what they are.
It’s on those protocol that you should apply your filter.

On Tue, Jun 23, 2015 at 2:34 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,

Thank you for your feedback, sorry its taken awhile to get back to you, very busy down here in NZ at the moment.

In this case i harvested WFS.
I have tested restricting the links as you have suggested and they are still there.

Here is the altered code, which i have tested with scope true and scope false as i was unsure if it needed to be changed to trigger the restriction.

I have also made sure that cached content is not be used and removed all records and harvested again.

Any ideas what i should check next?


module.directive(‘gnFixMdlinks’, [

function() {

return {
restrict: ‘A’,
scope: true,
link: function(scope) {
//scope.links = scope.md.getLinksByType(‘LINK’);
//scope.downloads = scope.md.getLinksByType(‘DOWNLOAD’);
//scope.layers = scope.md.getLinksByType(‘OGC’, ‘kml’);
scope.layers = scope.md.getLinksByType(‘#OGC:WMS’);
//scope.maps = scope.md.getLinksByType(‘ows’);
}
};
}]);


Florent Gravin
Camptocamp - Chambéry
0479444492

On Thu, Jun 11, 2015 at 8:31 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Did you harvest a WFS server or WMS ?
Then, is it the metadata of service that cause the problem, or the metadatas of dataset ?

The button is generated here
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/partials/viewtemplates/grid.html#L133

The array of layers is generated with
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/ResultsviewDirective.js#L169

This method will catch all links (online resources of the metadata) for which the procol contains OGC or kml.
You can just restricit the call here by using scope.layers = scope.md.getLinksByType(‘OGC:WMS’);.
Note that if you call for ‘OGC:WMS’ it will look for all links that the protocol contains the string, if you use ‘#OGC:WMS’, then it will check the protocol to equal the string.

On Wed, Jun 10, 2015 at 10:50 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi there,

When harvesting wfs from geoserver the results that are returned include entries for all formats available for a given layer.
While this is good for being able to access those links and services, on the results search pages the drop down that allows you to add layers to your map includes all results for a given layer.

Of those results only one layer can be added (normally the first layer) the other items cannot be loaded as they are links to access / download the layer in a specific format.

So in essence you have one layer that adds to your map and formats for the same layer that cannot be added.

Is there a way to filter the items in this list?

I have had a look at the code behind and i think i have drilled down to the function that loads the layer array results.
(forgive me if i have the wrong one as this is the first time i have looked at implementing Geonetwork)

In the Catalog default view folder ( catalog/default/view ) the module.js file contains the following function.
Which if i read it correctly loads a map layer to the map if it is not already there and can load all the layers in the list if wanted.

I believe this is populated by loading a layer and all its online resource link records.


$scope.resultviewFns = {
addMdLayerToMap: function (link, md) {

if (gnMap.isLayerInMap(viewerMap,
link.name, link.url)) {
return;
}
gnMap.addWmsFromScratch(viewerMap, link.url, link.name, false, md);
},
addAllMdLayersToMap: function (layers, md) {
angular.forEach(layers, function (layer) {
$scope.resultviewFns.addMdLayerToMap(layer, md);
});
},
loadMap: function (map, md) {
gnOwsContextService.loadContextFromUrl(map.url, viewerMap);
}
};

my question is this… can the array of results be filtered in some way to hide the results that are not able to be loaded onto the Map page?

Maybe by adding an extra option (check box) to the associated online resources you wish have available to add to the Map (Off by default)

Extra info:
The online resources in the capabilities xml includes the following <ows:Parameter name=“outputFormat”> and an associated online resource record is generated for each.

<ows:Parameter name=“outputFormat”>
ows:Valuetext/xml; subtype=gml/3.1.1</ows:Value>
ows:ValueDXF</ows:Value>
ows:ValueDXF-ZIP</ows:Value>
ows:ValueGML2</ows:Value>
ows:ValueKML</ows:Value>
ows:ValueSHAPE-ZIP</ows:Value>
ows:Valueapplication/gml+xml; version=3.2</ows:Value>
ows:Valueapplication/json</ows:Value>
ows:Valueapplication/vnd.google-earth.kml xml</ows:Value>
ows:Valueapplication/vnd.google-earth.kml+xml</ows:Value>
ows:Valuecsv</ows:Value>
ows:Valuegml3</ows:Value>
ows:Valuegml32</ows:Value>
ows:Valuejson</ows:Value>
ows:Valuetext/xml; subtype=gml/2.1.2</ows:Value>
ows:Valuetext/xml; subtype=gml/3.2</ows:Value>
</ows:Parameter>



GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Florent Gravin
Camptocamp - Chambéry
0479444492

Florent Gravin
Camptocamp - Chambéry
0479444492

Just do your fixes in debug mode, when it’s done, you need to remove wro4j.hb databases that are in your GEONETWORK DATA_DIR

(attachments)








···

On Tue, Jun 30, 2015 at 10:48 AM, Peter <upploadds@anonymised.com> wrote:

Hi Florent,
Running in tomcat 8 with the web app deployed from war. I’ll test out the change again in debug mode as you have suggested.

I’ve heard tomcat likes to hold onto cached code so will investigate this side of things as well.

Cheers
Peter


From: Florent Gravin
Sent: ‎30/‎06/‎2015 8:24 p.m.
To: Peter Van Dijk
Cc: geonetwork-devel@anonymised.comsourceforge.net
Subject: Re: [GeoNetwork-devel] geonetwork 3

Hi,

Ok, first, are you running your geonetwork with jetty or tomcat ?
If you changed the line scope.layers = scope.md.getLinksByType(‘OGC:WMS’);.
Then you need to run your search page in debug mode to see the change:
srv/eng/catalog.search?debug, cause in env-prod profile, the wro4j doesn’t compile javascript on change.

You should see your change in the search result list.
In the metadataview (4th screenshot), it’s managed in a different place, it’s a bit more complex to change the behavior.
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/metadataactions/MetadataActionsDirective.js

On Tue, Jun 30, 2015 at 3:31 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,
Here are the Geonetwork screen shots as requested.








Florent Gravin
Camptocamp - Chambéry
0479444492

On Tue, Jun 30, 2015 at 1:21 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,
Here are the screenshots as discussed.

cheers

On Mon, Jun 29, 2015 at 9:03 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Yes please, send a screen shot

On Sat, Jun 27, 2015 at 2:08 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi florent,

Nearly, when you harvest a WFS (in my case geoserver), you end up with the following.
For each layer / resource available in the WFS get capabilities request you end up with a record for the layer.
Attached to each record are the online resource records that describe the formats that each layer is available to download in.

When you edit the record for the layer, each of the attached online resource records have the protocol OGC:WFS-1.0.0-http-get-feature

The online resource records for each WFS layer are the records that I wish to remove / filter from the add to map button list.

For clarification i can attach screen shots if you wish?

cheers

Peter Van Dijk

Florent Gravin
Camptocamp - Chambéry
0479444492

On Fri, Jun 26, 2015 at 8:44 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Sorry i’m a bit lost with your issue, to sump up, you have only one online resource, it has protocol OGC:WFS-1.0.0-http-get-feature, but, in the mosaic result list, the globe button to add to the map has many values in the dropown ?

On Fri, Jun 26, 2015 at 3:58 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Florent Gravin
Camptocamp - Chambéry
0479444492

Hi Florent,
If you are meaning the Protocol listed for the online resource within the metadata record it is listed as OGC:WFS-1.0.0-http-get-feature

cheers

On Tue, Jun 23, 2015 at 10:49 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Look at the gmd:online in the XML of your metadata, look the gmd:protocol of each online resource and tell me what they are.
It’s on those protocol that you should apply your filter.

On Tue, Jun 23, 2015 at 2:34 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,

Thank you for your feedback, sorry its taken awhile to get back to you, very busy down here in NZ at the moment.

In this case i harvested WFS.
I have tested restricting the links as you have suggested and they are still there.

Here is the altered code, which i have tested with scope true and scope false as i was unsure if it needed to be changed to trigger the restriction.

I have also made sure that cached content is not be used and removed all records and harvested again.

Any ideas what i should check next?


module.directive(‘gnFixMdlinks’, [

function() {

return {
restrict: ‘A’,
scope: true,
link: function(scope) {
//scope.links = scope.md.getLinksByType(‘LINK’);
//scope.downloads = scope.md.getLinksByType(‘DOWNLOAD’);
//scope.layers = scope.md.getLinksByType(‘OGC’, ‘kml’);
scope.layers = scope.md.getLinksByType(‘#OGC:WMS’);
//scope.maps = scope.md.getLinksByType(‘ows’);
}
};
}]);


Florent Gravin
Camptocamp - Chambéry
0479444492

On Thu, Jun 11, 2015 at 8:31 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Did you harvest a WFS server or WMS ?
Then, is it the metadata of service that cause the problem, or the metadatas of dataset ?

The button is generated here
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/partials/viewtemplates/grid.html#L133

The array of layers is generated with
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/ResultsviewDirective.js#L169

This method will catch all links (online resources of the metadata) for which the procol contains OGC or kml.
You can just restricit the call here by using scope.layers = scope.md.getLinksByType(‘OGC:WMS’);.
Note that if you call for ‘OGC:WMS’ it will look for all links that the protocol contains the string, if you use ‘#OGC:WMS’, then it will check the protocol to equal the string.

On Wed, Jun 10, 2015 at 10:50 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi there,

When harvesting wfs from geoserver the results that are returned include entries for all formats available for a given layer.
While this is good for being able to access those links and services, on the results search pages the drop down that allows you to add layers to your map includes all results for a given layer.

Of those results only one layer can be added (normally the first layer) the other items cannot be loaded as they are links to access / download the layer in a specific format.

So in essence you have one layer that adds to your map and formats for the same layer that cannot be added.

Is there a way to filter the items in this list?

I have had a look at the code behind and i think i have drilled down to the function that loads the layer array results.
(forgive me if i have the wrong one as this is the first time i have looked at implementing Geonetwork)

In the Catalog default view folder ( catalog/default/view ) the module.js file contains the following function.
Which if i read it correctly loads a map layer to the map if it is not already there and can load all the layers in the list if wanted.

I believe this is populated by loading a layer and all its online resource link records.


$scope.resultviewFns = {
addMdLayerToMap: function (link, md) {

if (gnMap.isLayerInMap(viewerMap,
link.name, link.url)) {
return;
}
gnMap.addWmsFromScratch(viewerMap, link.url, link.name, false, md);
},
addAllMdLayersToMap: function (layers, md) {
angular.forEach(layers, function (layer) {
$scope.resultviewFns.addMdLayerToMap(layer, md);
});
},
loadMap: function (map, md) {
gnOwsContextService.loadContextFromUrl(map.url, viewerMap);
}
};

my question is this… can the array of results be filtered in some way to hide the results that are not able to be loaded onto the Map page?

Maybe by adding an extra option (check box) to the associated online resources you wish have available to add to the Map (Off by default)

Extra info:
The online resources in the capabilities xml includes the following <ows:Parameter name=“outputFormat”> and an associated online resource record is generated for each.

<ows:Parameter name=“outputFormat”>
ows:Valuetext/xml; subtype=gml/3.1.1</ows:Value>
ows:ValueDXF</ows:Value>
ows:ValueDXF-ZIP</ows:Value>
ows:ValueGML2</ows:Value>
ows:ValueKML</ows:Value>
ows:ValueSHAPE-ZIP</ows:Value>
ows:Valueapplication/gml+xml; version=3.2</ows:Value>
ows:Valueapplication/json</ows:Value>
ows:Valueapplication/vnd.google-earth.kml xml</ows:Value>
ows:Valueapplication/vnd.google-earth.kml+xml</ows:Value>
ows:Valuecsv</ows:Value>
ows:Valuegml3</ows:Value>
ows:Valuegml32</ows:Value>
ows:Valuejson</ows:Value>
ows:Valuetext/xml; subtype=gml/2.1.2</ows:Value>
ows:Valuetext/xml; subtype=gml/3.2</ows:Value>
</ows:Parameter>



GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Florent Gravin
Camptocamp - Chambéry
0479444492

camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

Florent Gravin
0479444492

Hi Florent,
Ok that works nicely, WFS doesn’t show the button at all and the second option in the button list for WMS layers has been dropped.

Did you know if there is a fix for the printing issue?

cheers

peter

···

On Tue, Jun 30, 2015 at 9:03 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Just do your fixes in debug mode, when it’s done, you need to remove wro4j.hb databases that are in your GEONETWORK DATA_DIR

On Tue, Jun 30, 2015 at 10:48 AM, Peter <upploadds@anonymised.com> wrote:

Hi Florent,
Running in tomcat 8 with the web app deployed from war. I’ll test out the change again in debug mode as you have suggested.

I’ve heard tomcat likes to hold onto cached code so will investigate this side of things as well.

Cheers
Peter


From: Florent Gravin
Sent: ‎30/‎06/‎2015 8:24 p.m.
To: Peter Van Dijk
Cc: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] geonetwork 3

Hi,

Ok, first, are you running your geonetwork with jetty or tomcat ?
If you changed the line scope.layers = scope.md.getLinksByType(‘OGC:WMS’);.
Then you need to run your search page in debug mode to see the change:
srv/eng/catalog.search?debug, cause in env-prod profile, the wro4j doesn’t compile javascript on change.

You should see your change in the search result list.
In the metadataview (4th screenshot), it’s managed in a different place, it’s a bit more complex to change the behavior.
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/metadataactions/MetadataActionsDirective.js

camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

Florent Gravin
0479444492

Florent Gravin
Camptocamp - Chambéry
0479444492

On Tue, Jun 30, 2015 at 1:21 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,
Here are the screenshots as discussed.

cheers

On Mon, Jun 29, 2015 at 9:03 PM, Florent Gravin <florent.gravin@anonymised.com.189…> wrote:

Yes please, send a screen shot

On Sat, Jun 27, 2015 at 2:08 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi florent,

Nearly, when you harvest a WFS (in my case geoserver), you end up with the following.
For each layer / resource available in the WFS get capabilities request you end up with a record for the layer.
Attached to each record are the online resource records that describe the formats that each layer is available to download in.

When you edit the record for the layer, each of the attached online resource records have the protocol OGC:WFS-1.0.0-http-get-feature

The online resource records for each WFS layer are the records that I wish to remove / filter from the add to map button list.

For clarification i can attach screen shots if you wish?

cheers

Peter Van Dijk

Florent Gravin
Camptocamp - Chambéry
0479444492

On Fri, Jun 26, 2015 at 8:44 PM, Florent Gravin <florent.gravin@…189…> wrote:

Hi,

Sorry i’m a bit lost with your issue, to sump up, you have only one online resource, it has protocol OGC:WFS-1.0.0-http-get-feature, but, in the mosaic result list, the globe button to add to the map has many values in the dropown ?

On Fri, Jun 26, 2015 at 3:58 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Florent Gravin
Camptocamp - Chambéry
0479444492

Hi Florent,
If you are meaning the Protocol listed for the online resource within the metadata record it is listed as OGC:WFS-1.0.0-http-get-feature

cheers

On Tue, Jun 23, 2015 at 10:49 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Look at the gmd:online in the XML of your metadata, look the gmd:protocol of each online resource and tell me what they are.
It’s on those protocol that you should apply your filter.

On Tue, Jun 23, 2015 at 2:34 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi Florent,

Thank you for your feedback, sorry its taken awhile to get back to you, very busy down here in NZ at the moment.

In this case i harvested WFS.
I have tested restricting the links as you have suggested and they are still there.

Here is the altered code, which i have tested with scope true and scope false as i was unsure if it needed to be changed to trigger the restriction.

I have also made sure that cached content is not be used and removed all records and harvested again.

Any ideas what i should check next?


module.directive(‘gnFixMdlinks’, [

function() {

return {
restrict: ‘A’,
scope: true,
link: function(scope) {
//scope.links = scope.md.getLinksByType(‘LINK’);
//scope.downloads = scope.md.getLinksByType(‘DOWNLOAD’);
//scope.layers = scope.md.getLinksByType(‘OGC’, ‘kml’);
scope.layers = scope.md.getLinksByType(‘#OGC:WMS’);
//scope.maps = scope.md.getLinksByType(‘ows’);
}
};
}]);


Florent Gravin
Camptocamp - Chambéry
0479444492

On Thu, Jun 11, 2015 at 8:31 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:

Hi,

Did you harvest a WFS server or WMS ?
Then, is it the metadata of service that cause the problem, or the metadatas of dataset ?

The button is generated here
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/partials/viewtemplates/grid.html#L133

The array of layers is generated with
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/search/resultsview/ResultsviewDirective.js#L169

This method will catch all links (online resources of the metadata) for which the procol contains OGC or kml.
You can just restricit the call here by using scope.layers = scope.md.getLinksByType(‘OGC:WMS’);.
Note that if you call for ‘OGC:WMS’ it will look for all links that the protocol contains the string, if you use ‘#OGC:WMS’, then it will check the protocol to equal the string.

On Wed, Jun 10, 2015 at 10:50 PM, Peter Van Dijk <upploadds@anonymised.com> wrote:

Hi there,

When harvesting wfs from geoserver the results that are returned include entries for all formats available for a given layer.
While this is good for being able to access those links and services, on the results search pages the drop down that allows you to add layers to your map includes all results for a given layer.

Of those results only one layer can be added (normally the first layer) the other items cannot be loaded as they are links to access / download the layer in a specific format.

So in essence you have one layer that adds to your map and formats for the same layer that cannot be added.

Is there a way to filter the items in this list?

I have had a look at the code behind and i think i have drilled down to the function that loads the layer array results.
(forgive me if i have the wrong one as this is the first time i have looked at implementing Geonetwork)

In the Catalog default view folder ( catalog/default/view ) the module.js file contains the following function.
Which if i read it correctly loads a map layer to the map if it is not already there and can load all the layers in the list if wanted.

I believe this is populated by loading a layer and all its online resource link records.


$scope.resultviewFns = {
addMdLayerToMap: function (link, md) {

if (gnMap.isLayerInMap(viewerMap,
link.name, link.url)) {
return;
}
gnMap.addWmsFromScratch(viewerMap, link.url, link.name, false, md);
},
addAllMdLayersToMap: function (layers, md) {
angular.forEach(layers, function (layer) {
$scope.resultviewFns.addMdLayerToMap(layer, md);
});
},
loadMap: function (map, md) {
gnOwsContextService.loadContextFromUrl(map.url, viewerMap);
}
};

my question is this… can the array of results be filtered in some way to hide the results that are not able to be loaded onto the Map page?

Maybe by adding an extra option (check box) to the associated online resources you wish have available to add to the Map (Off by default)

Extra info:
The online resources in the capabilities xml includes the following <ows:Parameter name=“outputFormat”> and an associated online resource record is generated for each.

<ows:Parameter name=“outputFormat”>
ows:Valuetext/xml; subtype=gml/3.1.1</ows:Value>
ows:ValueDXF</ows:Value>
ows:ValueDXF-ZIP</ows:Value>
ows:ValueGML2</ows:Value>
ows:ValueKML</ows:Value>
ows:ValueSHAPE-ZIP</ows:Value>
ows:Valueapplication/gml+xml; version=3.2</ows:Value>
ows:Valueapplication/json</ows:Value>
ows:Valueapplication/vnd.google-earth.kml xml</ows:Value>
ows:Valueapplication/vnd.google-earth.kml+xml</ows:Value>
ows:Valuecsv</ows:Value>
ows:Valuegml3</ows:Value>
ows:Valuegml32</ows:Value>
ows:Valuejson</ows:Value>
ows:Valuetext/xml; subtype=gml/2.1.2</ows:Value>
ows:Valuetext/xml; subtype=gml/3.2</ows:Value>
</ows:Parameter>



GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Florent Gravin
Camptocamp - Chambéry
0479444492

Did you know if there is a fix for the printing issue?

Do you use Tomcat8 ?

*camptocamp*
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

*Florent Gravin*
0479444492

Hi florent,
Yes running tomcat 8

···

Did you know if there is a fix for the printing issue?

Do you use Tomcat8 ?

camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

Florent Gravin
0479444492

Ok then mapfish print didn’t work for tomcat 8, it was fixed, so get last 3.0.x branch or wait for 3.0.1 release.
Cheers

···

On Wed, Jul 1, 2015 at 9:44 AM, Peter <upploadds@anonymised.com> wrote:

Hi florent,
Yes running tomcat 8


From: Florent Gravin
Sent: ‎1/‎07/‎2015 7:37 p.m.
To: Peter Van Dijk
Cc: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] geonetwork 3

Did you know if there is a fix for the printing issue?

Do you use Tomcat8 ?

camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

Florent Gravin
0479444492

camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

Florent Gravin
0479444492

Hi florent,
In the screen shots included the other day one shows printing from the map.
Currently printing doesn’t function and I am unsure how to add layouts

Cheers

···

Did you know if there is a fix for the printing issue?

Do you use Tomcat8 ?

camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

Florent Gravin
0479444492

Ok I’ll have a look at the latest branch.

3.0.1 release proposed for end of July I think?

Thanks for your help
Its coming together nicely and the modern webui is great

···

On Wed, Jul 1, 2015 at 9:44 AM, Peter <upploadds@anonymised.com> wrote:

Hi florent,
Yes running tomcat 8


From: Florent Gravin
Sent: ‎1/‎07/‎2015 7:37 p.m.
To: Peter Van Dijk
Cc: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] geonetwork 3

Did you know if there is a fix for the printing issue?

Do you use Tomcat8 ?

camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

Florent Gravin
0479444492

camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS

Florent Gravin
0479444492