Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:geonetwork/core-geonetwork into …
Browse files Browse the repository at this point in the history
…develop
  • Loading branch information
Jesse Eichar committed Mar 13, 2014
2 parents 150e40a + 3b1128a commit df6edca
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 49 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/fao/geonet/kernel/mef/MEFLib.java
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ static Element buildInfoPrivileges(ServiceContext context, Metadata md)
Operation operation = operationRepository.findOne(operationAllowed.getId().getOperationId());
String operName = operation.getName();

if (grpOwnerId == grpId) {
if (grpOwnerId != null && grpOwnerId == grpId) {
grpOwnerName = grpName;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ public Element exec(Element params, ServiceContext context) throws Exception
List<Integer> displayOrderList = new ArrayList<Integer>();
for (Element record : responseRecords) {
String displayOrder = record.getChildText("displayorder");
if (displayOrder == null || displayOrder.equals("")) {
if (displayOrder == null ||
displayOrder.equals("") ||
displayOrder.equals("null")) {
displayOrder = "-1";
}
Integer displayOrderI = Integer.parseInt(displayOrder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,27 @@
*/
module.directive('gnAutogrow', function() {
// add helper for measurement to body
var testObj = angular.element('<textarea id="autogrow-helper"' +
' style="height: 0; position: absolute; top: -999px"/>');
var testObj = angular.element('<textarea ' +
' style="height: 0px; position: absolute; "/>');
angular.element(window.document.body).append(testObj);

return {
restrict: 'A',
link: function(scope, element, attrs) {
var maxHeight = 1000;
var defaultWidth = 400;
var adjustHeight = function() {
var height, width = element[0].clientWidth;
// Height is computed based on scollHeight from
// the testObj. Max height is 1000px.
// Width is set to the element width
// or its parent if hidden (eg. multilingual field
// on load).
var height,
width = element.is(':hidden') ?
element.parent().width() || defaultWidth :
element[0].clientWidth;
testObj.css('width', width + 'px').val(element.val());
height = testObj[0].scrollHeight;
height = Math.min(testObj[0].scrollHeight, maxHeight);
element.css('height', height + 18 + 'px');
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
label: 'metadataFormatter',
icon: 'fa-print',
href: '#/metadata/formatter'
},{
type: 'schematron',
label: 'schematron',
icon: 'fa-eye',
href: '#/metadata/schematron'
// },{
// type: 'schematron',
// label: 'schematron',
// icon: 'fa-eye',
// href: '#/metadata/schematron'
}]
};

Expand Down
79 changes: 43 additions & 36 deletions web-ui/src/main/resources/catalog/js/admin/HarvestController.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
'$scope', '$http', '$translate', '$injector', '$rootScope',
'gnSearchManagerService', 'gnUtilityService',
function($scope, $http, $translate, $injector, $rootScope,
gnSearchManagerService, gnUtilityService) {
gnSearchManagerService, gnUtilityService) {

$scope.pageMenu = {
folder: 'harvest/',
Expand Down Expand Up @@ -53,7 +53,7 @@
function loadHistory() {
$scope.harvesterHistory = undefined;
$http.get('admin.harvester.history@json?uuid=' +
$scope.harvesterSelected.site.uuid).success(function(data) {
$scope.harvesterSelected.site.uuid).success(function(data) {
$scope.harvesterHistory = data.harvesthistory;
}).error(function(data) {
// TODO
Expand All @@ -63,20 +63,20 @@
function loadHarvesterTypes() {
$http.get('admin.harvester.info@json?type=harvesterTypes',
{cache: true})
.success(function(data) {
.success(function(data) {
angular.forEach(data[0], function(value) {
$scope.harvesterTypes[value] = {
label: value,
text: $translate(value)
};
$.getScript('../../catalog/templates/admin/harvest/type/' +
value + '.js')
.done(function(script, textStatus) {
.done(function(script, textStatus) {
$scope.harvesterTypes[value].loaded = true;
// FIXME: could we make those harvester specific
// function a controller
})
.fail(function(jqxhr, settings, exception) {
.fail(function(jqxhr, settings, exception) {
$scope.harvesterTypes[value].loaded = false;
});
});
Expand Down Expand Up @@ -144,10 +144,10 @@

$scope.saveHarvester = function() {
var body = window['gnHarvester' + $scope.harvesterSelected['@type']]
.buildResponse($scope.harvesterSelected, $scope);
.buildResponse($scope.harvesterSelected, $scope);

$http.post('admin.harvester.' +
($scope.harvesterNew ? 'add' : 'update') +
($scope.harvesterNew ? 'add' : 'update') +
'@json', body, {
headers: {'Content-type': 'application/xml'}
}).success(function(data) {
Expand Down Expand Up @@ -198,8 +198,8 @@
};
$scope.deleteHarvester = function() {
$http.get('admin.harvester.remove@json?id=' +
$scope.harvesterSelected['@id'])
.success(function(data) {
$scope.harvesterSelected['@id'])
.success(function(data) {
$scope.harvesterSelected = {};
$scope.harvesterUpdated = false;
$scope.harvesterNew = false;
Expand All @@ -211,8 +211,8 @@

$scope.deleteHarvesterRecord = function() {
$http.get('admin.harvester.clear@json?id=' +
$scope.harvesterSelected['@id'])
.success(function(data) {
$scope.harvesterSelected['@id'])
.success(function(data) {
$scope.harvesterSelected = {};
$scope.harvesterUpdated = false;
$scope.harvesterNew = false;
Expand All @@ -227,16 +227,16 @@
ids.push(h.id);
});
$http.get('admin.harvester.history.delete@json?id=' + ids.join('&id='))
.success(function(data) {
.success(function(data) {
loadHarvesters().then(function() {
$scope.selectHarvester($scope.harvesterSelected);
});
});
};
$scope.runHarvester = function() {
$http.get('admin.harvester.run@json?id=' +
$scope.harvesterSelected['@id'])
.success(function(data) {
$scope.harvesterSelected['@id'])
.success(function(data) {
loadHarvesters();
});
};
Expand All @@ -247,8 +247,8 @@
}
var status = $scope.harvesterSelected.options.status;
$http.get('admin.harvester.' +
(status === 'active' ? 'start' : 'stop') +
'@json?id=' +
(status === 'active' ? 'start' : 'stop') +
'@json?id=' +
$scope.harvesterSelected['@id'])
.success(function(data) {

Expand Down Expand Up @@ -278,7 +278,7 @@
$scope.geonetworkGetSources = function(url) {
$http.get($scope.proxyUrl +
encodeURIComponent(url + '/srv/eng/info?type=sources'))
.success(function(data) {
.success(function(data) {
$scope.geonetworkSources = [];
var i = 0;
var xmlDoc = $.parseXML(data);
Expand Down Expand Up @@ -324,7 +324,7 @@
// TODO : enable watch only if OAIPMH
$scope.$watch('harvesterSelected.site.url', function() {
if ($scope.harvesterSelected &&
$scope.harvesterSelected['@type'] === 'oaipmh') {
$scope.harvesterSelected['@type'] === 'oaipmh') {
$scope.oaipmhGet();
}
});
Expand All @@ -345,8 +345,8 @@
$scope.cswCriteriaInfo = null;

if ($scope.harvesterSelected &&
$scope.harvesterSelected.site &&
$scope.harvesterSelected.site.capabilitiesUrl) {
$scope.harvesterSelected.site &&
$scope.harvesterSelected.site.capabilitiesUrl) {


var url = $scope.harvesterSelected.site.capabilitiesUrl;
Expand All @@ -360,8 +360,8 @@
}

$http.get($scope.proxyUrl +
encodeURIComponent(url))
.success(function(data) {
encodeURIComponent(url))
.success(function(data) {
$scope.cswCriteria = [];

var i = 0;
Expand All @@ -377,24 +377,31 @@
var matches = ['SupportedISOQueryables',
'SupportedQueryables',
'AdditionalQueryables'];

$xml.find('Constraint').each(function() {
var parseCriteriaFn = function() {
var name = $(this).text();
$scope.cswCriteria.push(name);
if (!$scope.harvesterSelected.searches[0][name]) {
$scope.harvesterSelected.searches[0][name] =
{value: ''};
}
};
var parseQueryablesFn = function() {
if (matches.indexOf($(this).attr('name')) !== -1) {

// Add all queryables to the list of possible parameters
// and to the current harvester if not exist.
// When harvester is saved only criteria with
// value will be saved.
$(this).find('Value').each(function() {
var name = $(this).text();
$scope.cswCriteria.push(name);
if (!$scope.harvesterSelected.searches[0][name]) {
$scope.harvesterSelected.searches[0][name] =
{value: ''};
}
});
$(this).find('Value').each(parseCriteriaFn);
$(this).find('ows\\:Value').each(parseCriteriaFn);
}
});
};
// For Chrome and IE
$xml.find('Constraint').each(parseQueryablesFn);
// For FF, namespace parsing is different
if ($scope.cswCriteria.length === 0) {
$xml.find('ows\\:Constraint').each(parseQueryablesFn);
}

$scope.cswCriteria.sort();

Expand Down Expand Up @@ -443,7 +450,7 @@
// When schema change reload the available XSLTs and templates
$scope.$watch('harvesterSelected.options.outputSchema', function() {
if ($scope.harvesterSelected &&
$scope.harvesterSelected['@type'] === 'wfsfeatures') {
$scope.harvesterSelected['@type'] === 'wfsfeatures') {
wfsGetFeatureXSLT();
loadHarvesterTemplates();
}
Expand Down Expand Up @@ -476,8 +483,8 @@
$scope.oaipmhInfo = null;
var opt = $scope.harvesterSelected.options;
var schema = ($scope.threddsCollectionsMode === 'DIF' ?
opt.outputSchemaOnCollectionsDIF :
opt.outputSchemaOnCollectionsFragments);
opt.outputSchemaOnCollectionsDIF :
opt.outputSchemaOnCollectionsFragments);
var body = '<request><type>threddsFragmentStylesheets</type><schema>' +
schema +
'</schema></request>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,8 @@

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<xsl:for-each select="gmd:dateStamp">
<Field name="changeDate" string="{string(gco:DateTime|gco:Date)}" store="true" index="true"/>
<xsl:for-each select="gmd:dateStamp/*">
<Field name="changeDate" string="{string(.)}" store="true" index="true"/>
</xsl:for-each>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
Expand Down

0 comments on commit df6edca

Please sign in to comment.