Skip to content

Commit

Permalink
Adding new cobweb view on separated maven project
Browse files Browse the repository at this point in the history
  • Loading branch information
Delawen committed Mar 3, 2015
1 parent c6606b4 commit f2724be
Show file tree
Hide file tree
Showing 47 changed files with 1,816 additions and 11 deletions.
181 changes: 181 additions & 0 deletions cobweb/src/main/resources/catalog/views/cobweb/config.js
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
});
}]);
})();
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.
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.
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";

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";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import "../../../style/gn_login";
@import "gn_view_cobweb";
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";
Loading

0 comments on commit f2724be

Please sign in to comment.