Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5253 metrics block ui #6040

Merged
merged 35 commits into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e73cb0e
Initial dataset pg layout revisions to move metrics block [ref #5253]
mheppler Jun 25, 2019
b2f037f
Refactoring dataset and file pg grid layout to get it more uniform ac…
mheppler Jun 25, 2019
3a566a1
Moved metrics block on file and dataset pgs, moved some stuff around …
mheppler Jun 27, 2019
7113c2e
Merge branch 'develop' into 5253-metrics-block-ui
mheppler Jul 1, 2019
b901cc3
Merge branch 'develop' into 5253-metrics-block-ui #5253
pdurbin Jul 12, 2019
3760d31
add TOC and easier way to start dev on UI #5253
pdurbin Jul 12, 2019
bc5d512
wire up downloads and views on dataset page #5253
pdurbin Jul 12, 2019
4483342
add render logic for classic vs MDC metrics #5253
pdurbin Jul 15, 2019
4d87282
better example, a citation from a paper #5253
pdurbin Jul 15, 2019
ac5de7f
add table of config options #5253
pdurbin Jul 15, 2019
a2a7b4b
help devs insert MDC citation #5253
pdurbin Jul 15, 2019
bf79aa1
Cleaned up UI of prototype code for metrics block, move placeholder l…
mheppler Jul 16, 2019
65d533d
Additional UI clean up of dataset and file pg citation blocks and met…
mheppler Jul 16, 2019
4ea8bcd
Added static Dataset Citations popup linked from Dataset Metrics bloc…
mheppler Jul 17, 2019
4b7370b
fix typo to get citations #5253
pdurbin Jul 18, 2019
29ec5b7
connect citation URLs from db to wireframe #5253
pdurbin Jul 18, 2019
0cc3a78
more elaborate tooltips #5253
pdurbin Jul 18, 2019
4e6593b
Restored old css for metrics on dataverse pg [ref #5253]
mheppler Jul 19, 2019
d2c3a9a
fix typo #5253
pdurbin Jul 22, 2019
aa215c7
Added User Guide link to citation popups from dataset metrics block, …
mheppler Jul 22, 2019
b94e54d
Fixed merge conflict in dataset citations bundle text [ref #5253]
mheppler Jul 22, 2019
e63cf5f
Merge branch 'develop' into 5253-metrics-block-ui #5253
pdurbin Jul 22, 2019
994159a
link to Crossref #5253
pdurbin Jul 22, 2019
9e5f801
dataset metrics documentation updates
djbrooke Jul 22, 2019
e451a14
update tooltip for file download
djbrooke Jul 22, 2019
203bc7f
updating URL for dataset metrics in the guides
djbrooke Jul 22, 2019
0b4d21f
use settingsWrapper for fewer db queries #5253
pdurbin Jul 22, 2019
fc48f29
adding crossref info to guides
djbrooke Jul 22, 2019
9c5013b
Updating a metrics tooltip.
TaniaSchlatter Jul 23, 2019
ff6c60c
updating tool tip
djbrooke Jul 23, 2019
d0347b6
Removed extrenal link from dataset citations popup help txt, fixed po…
mheppler Jul 24, 2019
b498fa3
Removed mistakenly committed dev code from dataset citation popup ren…
mheppler Jul 24, 2019
7cb2cbf
Moved file pg text labels to bundle, added alt text to preview img [r…
mheppler Aug 1, 2019
f1f7828
Fixed float issue with Cite Dataset/Data File dropdown menu on datase…
mheppler Aug 8, 2019
a621e7b
Added empty results msg to metrics citation popup [ref #5253]
mheppler Aug 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion doc/sphinx-guides/source/admin/make-data-count.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,19 @@ The most important takeaways from the diagram are:
Limitations for Dataverse Installations Using Handles Rather Than DOIs
----------------------------------------------------------------------

Data repositories using Handles and other identifiers are not supported by Make Data Count but in the notes_ following a July 2018 webinar, you can see the Make Data Count project's response on this topic. In short, the DataCite hub does not want to receive reports for non-DOI datasets. Additionally, citations are only available from the DataCite hub for datasets that have DOIs.
Data repositories using Handles and other identifiers are not supported by Make Data Count but in the notes_ following a July 2018 webinar, you can see the Make Data Count project's response on this topic. In short, the DataCite hub does not want to receive reports for non-DOI datasets. Additionally, citations are only available from the DataCite hub for datasets that have DOIs. See also the table below.

+---------------------+---------------+------------------+
| | DOIs | Handles |
+=====================+===============+==================+
| **Out of the box** | Classic | Classic |
| | download | download |
| | counts | counts |
+---------------------+---------------+------------------+
| **Make Data Count** | MDC views, | MDC views, |
| | MDC downloads,| MDC downloads |
| | MDC citations | |
+---------------------+---------------+------------------+

This being said, the Dataverse usage logging can still generate logs and process those logs with Counter Processor to create json that details usage on a dataset level. Dataverse can ingest this locally generated json.

Expand Down
15 changes: 15 additions & 0 deletions doc/sphinx-guides/source/developers/make-data-count.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Make Data Count

Support for Make Data Count is a feature of Dataverse that is described in the :doc:`/admin/make-data-count` section of the Admin Guide. In order for developers to work on the feature, they must install Counter Processor, a Python 3 application, as described below. Counter Processor can be found at https://github.com/CDLUC3/counter-processor

.. contents:: |toctitle|
:local:

Architecture
------------

Expand All @@ -13,6 +16,18 @@ There are many components involved in Dataverse's architecture for Make Data Cou
Dev Environment Setup for Make Data Count
-----------------------------------------

Generate Fake Metrics Only
~~~~~~~~~~~~~~~~~~~~~~~~~~

The quickest way to put populate tables with some data is to run the ``MakeDataCountApiIT`` integration test. For more on running integration tests see the :doc:`testing` section. This will populate views and downloads.

To insert a citation you could insert a row like below, changing "72" in the example below with the dataset id for your dataset.

``INSERT INTO datasetexternalcitations (id, citedbyurl, dataset_id) VALUES (1, 'https://doi.org/10.1007/s12520-017-0578-2', 72);``

Full Setup
~~~~~~~~~~

The recommended way to work on the Make Data Count feature is to spin up an EC2 instance that has both Dataverse and Counter Processor installed. Go to the :doc:`deployment` page for details on how to spin up an EC2 instance and make sure that your Ansible file is configured to install Counter Processor before running the "create" script.

(Alternatively, you can try installing Counter Processor in Vagrant. :download:`setup-counter-processor.sh <../../../../scripts/vagrant/setup-counter-processor.sh>` might help you get it installed.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.ListIterator;
import java.util.Set;
import java.util.concurrent.Future;
import java.util.logging.Logger;
import javax.ejb.EJB;
import javax.ejb.EJBException;
import javax.ejb.Stateless;
Expand All @@ -32,6 +33,8 @@
@Named
@Stateless
public class DatasetMetricsServiceBean implements java.io.Serializable {

private static final Logger logger = Logger.getLogger(DatasetMetricsServiceBean.class.getCanonicalName());

@PersistenceContext(unitName = "VDCNet-ejbPU")
protected EntityManager em;
Expand All @@ -58,6 +61,12 @@ public DatasetMetrics getDatasetMetricsByDatasetMonthCountry(Dataset dataset, St
return null;
}

public DatasetMetrics getMetrics(Dataset dataset) {
String nullMonthYear = null;
String nullCountry = null;
return getDatasetMetricsByDatasetForDisplay(dataset, nullMonthYear, nullCountry);
}

public DatasetMetrics getDatasetMetricsByDatasetForDisplay(Dataset dataset, String monthYear, String country) {

Long dataset_id = dataset.getId();
Expand Down
19 changes: 15 additions & 4 deletions src/main/java/propertyFiles/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1211,11 +1211,22 @@ dataset.exportBtn.itemLabel.oai_ore=OAI_ORE
dataset.exportBtn.itemLabel.dataciteOpenAIRE=OpenAIRE
metrics.title=Metrics
metrics.title.tip=View more metrics information
metrics.comingsoon=Coming soon...
metrics.views=Views
metrics.dataset.title=Dataset Metrics
metrics.dataset.tip.default=Aggregated metrics for this dataset.
metrics.dataset.tip.makedatacount=Metrics collected using Make Data Count standards.
metrics.dataset.views.tip=Dataset views are combined with aggregated file views.
metrics.dataset.downloads.default.tip=Total aggregated downloads of files in this dataset.
metrics.dataset.downloads.makedatacount.tip=Each file download (single or multiple files) increments the download count.
metrics.dataset.citations.tip=Click for a list of citation URLs.
metrics.file.title=File Metrics
metrics.file.tip.default=Metrics for this individual file.
metrics.file.tip.makedatacount=Individual file downloads are tracked but this is not part of the Make Data Count standard.
metrics.file.downloads.tip=Total downloads of this file.
metrics.views={0, choice, 0#Views|1#View|2#Views}
metrics.downloads={0, choice, 0#Downloads|1#Download|2#Downloads}
metrics.citations=Citations
metrics.shares=Shares
metrics.citations={0, choice, 0#Citations|1#Citation|2#Citations}
metrics.citations.dialog.header=Dataset Citations
metrics.citations.dialog.help=Citations for this dataset are retrieved from <a href="https://www.crossref.org" title="Crossref" target="_blank">Crossref</a> via DataCite using Make Data Count standards. For more information about dataset metrics, please refer to the <a href="{0}/{1}/user/dataset-management.html#dataset-metrics-user" title="Dataset Metrics - Dataverse User Guide" target="_blank">User Guide</a>.
djbrooke marked this conversation as resolved.
Show resolved Hide resolved
dataset.publish.btn=Publish
dataset.publish.header=Publish Dataset
dataset.rejectBtn=Return to Author
Expand Down
12 changes: 7 additions & 5 deletions src/main/webapp/dataset-citation.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
xmlns:o="http://omnifaces.org/ui"
xmlns:jsf="http://xmlns.jcp.org/jsf">

<div class="row citation-block">
<div class="col-xs-12 #{DatasetPage.workingVersion.deaccessioned ? 'alert alert-danger bg-danger' : 'alert alert-info bg-citation'}">
<div class="#{widgetWrapper.widgetView ? 'col-sm-12' : 'col-sm-9'} citation-block">
<div class="col-sm-12 #{DatasetPage.workingVersion.deaccessioned ? 'alert alert-danger bg-danger' : 'alert alert-info bg-citation'}">
<div class="row ">
<div class="#{DatasetPage.workingVersion.deaccessioned ? 'col-xs-12' : 'col-xs-7 col-md-8'} citation">
<div class="col-sm-12 citation">
<span class="citation-select" onclick="if (event.target) { selectText(event.target); } else{ selectText(this); }">
<h:outputText value="#{DatasetPage.displayCitation}" escape="false"/>
</span>
Expand All @@ -21,7 +21,7 @@
<span class="glyphicon glyphicon-question-sign text-primary" jsf:rendered="#{DatasetPage.workingVersion.deaccessioned}"
data-toggle="tooltip" data-placement="top" data-original-title="#{bundle['dataset.cite.title.deassessioned']}"/>
</div>
<div class="col-xs-5 col-md-4 text-right citation-download" jsf:rendered="#{!DatasetPage.workingVersion.deaccessioned}">
<div class="col-sm-6 citation-download vcenter" jsf:rendered="#{!DatasetPage.workingVersion.deaccessioned}">
<div class="dropdown">
<button type="button" class="btn btn-default dropdown-toggle downloadCitation" data-toggle="dropdown">
<span class="glyphicon glyphicon-list"/> #{bundle['dataset.cite.downloadBtn']} <span class="caret"></span>
Expand All @@ -44,7 +44,9 @@
</li>
</ul>
</div>
<div class="small text-muted text-right citation-standards"><h:outputText value="#{bundle['dataset.cite.standards.tip']}" escape="false"/></div>
</div>
<div class="col-sm-6 text-right small text-muted citation-standards vcenter" jsf:rendered="#{!DatasetPage.workingVersion.deaccessioned}">
<h:outputText value="#{bundle['dataset.cite.standards.tip']}" escape="false"/>
</div>
</div>
</div>
Expand Down
Loading