forked from geonetwork/core-geonetwork
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new cobweb view on separated maven project
- Loading branch information
Showing
47 changed files
with
1,816 additions
and
11 deletions.
There are no files selected for viewing
181 changes: 181 additions & 0 deletions
181
cobweb/src/main/resources/catalog/views/cobweb/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
(function() { | ||
|
||
goog.provide('gn_search_cobweb_config'); | ||
|
||
var module = angular.module('gn_search_cobweb_config', []); | ||
|
||
module | ||
.run([ | ||
'gnSearchSettings', | ||
'gnViewerSettings', | ||
'gnOwsContextService', | ||
'gnMap', | ||
function(searchSettings, viewerSettings, gnOwsContextService, gnMap) { | ||
// Load the context defined in the configuration | ||
viewerSettings.defaultContext = | ||
viewerSettings.mapConfig.viewerMap || | ||
'../../map/config-viewer.xml'; | ||
|
||
// Keep one layer in the background | ||
// while the context is not yet loaded. | ||
viewerSettings.bgLayers = [ | ||
gnMap.createLayerForType('osm') | ||
]; | ||
|
||
viewerSettings.servicesUrl = | ||
viewerSettings.mapConfig.listOfServices || {}; | ||
|
||
var bboxStyle = new ol.style.Style({ | ||
stroke: new ol.style.Stroke({ | ||
color: 'rgba(255,0,0,1)', | ||
width: 2 | ||
}), | ||
fill: new ol.style.Fill({ | ||
color: 'rgba(255,0,0,0.3)' | ||
}) | ||
}); | ||
searchSettings.olStyles = { | ||
drawBbox: bboxStyle, | ||
mdExtent: new ol.style.Style({ | ||
stroke: new ol.style.Stroke({ | ||
color: 'orange', | ||
width: 2 | ||
}) | ||
}), | ||
mdExtentHighlight: new ol.style.Style({ | ||
stroke: new ol.style.Stroke({ | ||
color: 'orange', | ||
width: 3 | ||
}), | ||
fill: new ol.style.Fill({ | ||
color: 'rgba(255,255,0,0.3)' | ||
}) | ||
}) | ||
}; | ||
|
||
/******************************************************************* | ||
* Define maps | ||
*/ | ||
var mapsConfig = { | ||
center: [280274.03240585705, 6053178.654789996], | ||
zoom: 2, | ||
maxResolution: 9783.93962050256 | ||
}; | ||
|
||
var viewerMap = new ol.Map({ | ||
controls: [], | ||
view: new ol.View(mapsConfig) | ||
}); | ||
|
||
var searchMap = new ol.Map({ | ||
controls:[], | ||
layers: [new ol.layer.Tile({ | ||
source: new ol.source.OSM() | ||
})], | ||
controls: [], | ||
view: new ol.View({ | ||
center: mapsConfig.center, | ||
zoom: 2 | ||
}) | ||
}); | ||
|
||
/** Facets configuration */ | ||
searchSettings.facetsSummaryType = 'hits'; | ||
|
||
/* | ||
* Hits per page combo values configuration. The first one is the | ||
* default. | ||
*/ | ||
searchSettings.hitsperpageValues = [20, 50, 100]; | ||
|
||
/* Pagination configuration */ | ||
searchSettings.paginationInfo = { | ||
hitsPerPage: searchSettings.hitsperpageValues[0] | ||
}; | ||
|
||
/* | ||
* Sort by combo values configuration. The first one is the default. | ||
*/ | ||
searchSettings.sortbyValues = [{ | ||
sortBy: 'relevance', | ||
sortOrder: '' | ||
}, { | ||
sortBy: 'changeDate', | ||
sortOrder: '' | ||
}, { | ||
sortBy: 'title', | ||
sortOrder: 'reverse' | ||
}, { | ||
sortBy: 'rating', | ||
sortOrder: '' | ||
}, { | ||
sortBy: 'popularity', | ||
sortOrder: '' | ||
}, { | ||
sortBy: 'denominatorDesc', | ||
sortOrder: '' | ||
}, { | ||
sortBy: 'denominatorAsc', | ||
sortOrder: 'reverse' | ||
}]; | ||
|
||
/* Default search by option */ | ||
searchSettings.sortbyDefault = searchSettings.sortbyValues[0]; | ||
|
||
/* Custom templates for search result views */ | ||
searchSettings.resultViewTpls = [ | ||
{ | ||
tplUrl: '../../catalog/components/search/resultsview/' + | ||
'partials/viewtemplates/grid.html', | ||
tooltip: 'Grid', | ||
icon: 'fa-th' | ||
}, | ||
{ | ||
tplUrl: '../../catalog/components/search/resultsview/' + | ||
'partials/viewtemplates/title.html', | ||
tooltip: 'List', | ||
icon: 'fa-list' | ||
}, | ||
{ | ||
tplUrl: '../../catalog/components/search/resultsview/' + | ||
'partials/viewtemplates/list.html', | ||
tooltip: 'Complete', | ||
icon: 'fa-th-list' | ||
}]; | ||
|
||
// For the time being metadata rendering is done | ||
// using Angular template. Formatter could be used | ||
// to render other layout | ||
|
||
// TODO: formatter should be defined per schema | ||
searchSettings.formatter = { | ||
// defaultUrl: 'md.format.xml?xsl=full_view&id=' | ||
defaultUrl: 'md.format.xml?xsl=xsl-view&id=', | ||
list: [{ | ||
// label: 'inspire', | ||
// url: 'md.format.xml?xsl=xsl-view' + '&view=inspire&id=' | ||
//}, { | ||
// label: 'full', | ||
// url: 'md.format.xml?xsl=xsl-view&view=advanced&id=' | ||
//}, { | ||
label: 'full', | ||
url: 'md.format.xml?xsl=full_view&id=' | ||
}] | ||
// TODO: maybe formatter config should depends | ||
// on the metadata schema. | ||
// schema: { | ||
// iso19139: 'md.format.xml?xsl=full_view&&id=' | ||
// } | ||
}; | ||
|
||
// Set the default template to use | ||
searchSettings.resultTemplate = | ||
searchSettings.resultViewTpls[0].tplUrl; | ||
|
||
// Set custom config in gnSearchSettings | ||
angular.extend(searchSettings, { | ||
viewerMap: viewerMap, | ||
searchMap: searchMap | ||
}); | ||
}]); | ||
})(); |
Binary file added
BIN
+209 KB
cobweb/src/main/resources/catalog/views/cobweb/images/background-repeat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.7 KB
cobweb/src/main/resources/catalog/views/cobweb/images/no-thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
cobweb/src/main/resources/catalog/views/cobweb/less/gn_admin_cobweb.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@import "../../../../../../../../web-ui/src/main/resources/catalog/views/default/less/gn_admin_default.less"; | ||
@import "gn_view_cobweb"; | ||
|
3 changes: 3 additions & 0 deletions
3
cobweb/src/main/resources/catalog/views/cobweb/less/gn_editor_cobweb.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@import "gn_search_cobweb"; | ||
@import "../../../style/gn_editor"; | ||
@import "gn_view_cobweb"; |
2 changes: 2 additions & 0 deletions
2
cobweb/src/main/resources/catalog/views/cobweb/less/gn_login_cobweb.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import "../../../style/gn_login"; | ||
@import "gn_view_cobweb"; |
40 changes: 40 additions & 0 deletions
40
cobweb/src/main/resources/catalog/views/cobweb/less/gn_search_cobweb.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@import "gn_search_default.css"; | ||
|
||
/* | ||
List of records | ||
*/ | ||
.gn-info-list { | ||
padding: 5px 0px; | ||
margin: auto -10px; | ||
li { | ||
width: 33.3%; | ||
zoom: 1; | ||
list-style: none; | ||
float: left; | ||
padding: 10px; | ||
> div { | ||
margin: 0px; | ||
padding: 15px; | ||
height: 125px; | ||
border-top-left-radius: 4px; | ||
border-top-right-radius: 4px; | ||
background-color: #fff; | ||
border: 1px solid #ddd; | ||
border-bottom: 2px solid #337ab7; | ||
cursor: pointer; | ||
> div.gn-md-thumbnail { | ||
float:left; | ||
width: 90px; | ||
height: 90px; | ||
margin-right: 15px; | ||
background-image: url(../catalog/views/default/images/no-thumbnail.png); | ||
.gn-img-thumbnail { | ||
max-height: 90px; | ||
max-width: 90px; | ||
margin-right: 15px; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
@import "gn_view_cobweb"; |
Oops, something went wrong.