Skip to content
josegar74 edited this page Apr 4, 2014 · 8 revisions
Date Apr 4 2014 Contacts Jose García
Status In Progress Release 2.12
Resources Ticket # https://github.com/geonetwork/core-geonetwork/issues/436
Source code coming soon
Funding Ontario Ministry of Natural Resources (OMNR)

Overview

This feature allows administrators to create the following reports in CSV format:

  • Internal metadata records (metadata not published to group ALL).
  • Updated metadata records during a period of time.
  • File uploads to metadata records in a period of time.
  • File downloads to metadata records in a period of time.
  • Users access in a period of time.

New reports can be added in the system in the future.

Technical Details:

User interface

A new AngularJS GnReportController handles the reports UI and invocation of Java services to create the CSV files.

To download the CSV as a file with Ajax POST is not that immediate/intuitive. When the Java service(s) that create the reports returns the responses, some "magic" is required to force the browser to download as a file. See success event in the following snippet:

     $scope.createReport = function (formId, service) {
        $http({
          method: 'POST',
          url: service,
          data: $(formId).serialize(),
          headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
          }
        })
          .success(function(data) {
            var element = angular.element('<a/>');
            element.attr({
              href: 'data:attachment/csv;charset=utf-8,' + encodeURI(data),
              target: '_blank',
              download: service
            })[0].click();

          })
      };

Users access

The User domain class has been enhanced to track the last login user date.

A new Spring ApplicationListener has been created to handle successful users login. The listener is configured in config-security-core.xml

  <!-- Listener to log the last login date in the database -->
  <bean class="org.fao.geonet.kernel.security.listener.UpdateTimestampListener" id="updateTimestampListener">

Metadata file uploads/downloads

Metadata file upload and download services have been extended to track this information to create the related reports:

  • User requesting the upload/download.
  • File uploaded/downloaded.
  • Date of upload/download.

Proposal Type:

  • Type: Admin-UI
  • Module: web-ui,domain,services,core

Voting History

  • Vote Proposed: TBA

Participants

  • All
Clone this wiki locally