Skip to content

Commit

Permalink
Merge pull request #2 from IQSS/develop
Browse files Browse the repository at this point in the history
update
  • Loading branch information
pkiraly authored Nov 21, 2018
2 parents 6ff8fa0 + 0045cd6 commit 5508277
Show file tree
Hide file tree
Showing 65 changed files with 3,203 additions and 469 deletions.
6 changes: 5 additions & 1 deletion conf/solr/7.3.0/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,14 @@
<field name="isHarvested" type="boolean" stored="true" indexed="true" multiValued="false"/>

<field name="dvName" type="text_en" stored="true" indexed="true" multiValued="false"/>
<field name="dvAlias" type="text_en" stored="true" indexed="true" multiValued="false"/>
<field name="dvAffiliation" type="text_en" stored="true" indexed="true" multiValued="false"/>
<field name="dvDescription" type="text_en" stored="true" indexed="true" multiValued="false"/>

<field name="dvCategory" type="string" stored="true" indexed="true" multiValued="false"/>

<field name="categoryOfDataverse" type="string" stored="true" indexed="true" multiValued="false"/>
<field name="identifierOfDataverse" type="string" stored="true" indexed="true" multiValued="false"/>

<field name="publicationDate" type="string" stored="true" indexed="true" multiValued="false"/>
<field name="dsPublicationDate" type="string" stored="true" indexed="true" multiValued="false"/>

Expand Down Expand Up @@ -456,6 +459,7 @@
<copyField source="variableLabel" dest="_text_" maxChars="3000"/>
<!-- Make dataverse subject and affiliation searchable from basic search: https://github.com/IQSS/dataverse/issues/1431 -->
<copyField source="dvSubject" dest="_text_" maxChars="3000"/>
<copyField source="dvAlias" dest="_text_" maxChars="3000"/>
<copyField source="dvAffiliation" dest="_text_" maxChars="3000"/>
<copyField source="dsPersistentId" dest="_text_" maxChars="3000"/>
<!-- copyField commands copy one field to another at the time a document
Expand Down
1 change: 1 addition & 0 deletions doc/release-notes/5011-search-by-dataverse-alias.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The Solr schema.xml file must be updated due to the addition of the "dvAlias" field.
12 changes: 12 additions & 0 deletions doc/release-notes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Dataverse Release Notes

doc/sphinx-guides/source/developers/making-releases.rst documents the official process for making release notes but as indicated there, we are experimenting with a process with the following goals:

- As a developer, I want to express in my pull request when an addition to the release notes will be necessary.
- As a developer, I want to be aware of changes that should be made to my dev environment after a pull request has been merged. I already know to look in `scripts/database/upgrades` if I pull the latest code from the "develop" branch for updates as described in doc/sphinx-guides/source/developers/sql-upgrade-scripts.rst but I want a place to look for non-SQL updates that are required. These could be Solr schema changes or curl commands to reload metadata blocks, for example.

# release-notes directory process

- Create a Markdown file named after your branch (assuming your branch starts with an issue number as requested in doc/sphinx-guides/source/developers/version-control.rst) such as "5053-apis-custom-homepage.md".
- In the file you created, give instructions for non-SQL upgrade steps that must be taken to run the branch in your pull request. Examples include Solr schema updates or reloading metadata blocks.
- At release time, gather all the files into final release notes and make a `git rm` commit to delete them to prevent clutter.
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@

<style>
/* Custom CSS for the custom homepage... */
.lite-header {font-weight: normal;}
div.hmpg-action-block {padding-top:1em;}
.btn-harvard {
color: #A51C30;
background: #FFFFFF;
font-weight: bold;
}
.btn-harvard:hover,
.btn-harvard:focus,
.btn-harvard:active,
.btn-harvard.active,
.open .dropdown-toggle.btn-harvard {
color: #7F000A;
background: #FFFFFF;
font-weight: bold;
}

div.search-widget {padding-bottom: 2em;}

@media (min-width: 768px) {
#dataversesBySubject {-webkit-column-count: 3; -moz-column-count: 3; column-count: 3;}
}
#dataversesBySubject p.browse-subjects {display:inline-block; width:100%; padding:0 2px;}
#dataversesBySubject p.browse-subjects a {color: #C55B28;}
#dataversesBySubject p.browse-subjects a:focus, p.browse-subjects a:hover {color: #9F3502;}

div.hmpg-recent-col div.col-xs-2.hmpg-recent-thumb {width: 48px !important;padding: 0 !important;}
div.hmpg-recent-col div.hmpg-recent-thumb img {max-height:48px;max-width:48px;}
div.hmpg-recent-col div.hmpg-recent-thumb span {font-size:38px;}

div.hmpg-activity-block .row .lite-header {margin-left:1em;}
</style>

<!-- ACTIONS -->
<div class="row hmpg-action-block">
<div class="col-sm-6 col-xs-12">
<div class="h4 lite-header">Deposit and share your data. Get academic credit.</div>
<p class="text-muted margin-bottom">Harvard Dataverse is a digital repository. Deposit data and code here.</p>
<a class="btn btn-default btn-harvard margin-top margin-bottom" href="/dataset.xhtml?ownerId=1">
Add data to Harvard Dataverse <span class="glyphicon glyphicon-plus"></span>
</a>
</div>
<div class="col-sm-6 col-xs-12">
<div class="h4 lite-header">Organize datasets and gather metrics in your own virtual archive.</div>
<p class="text-muted margin-bottom">A dataverse is a virtual archive. A dataverse can contain dataverses, datasets, files and metadata.</p>
<a class="btn btn-default btn-harvard margin-top margin-bottom" href="/dataverse.xhtml?ownerId=1">
Create my own dataverse <span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div>

<hr/>

<!-- SEARCH + BROWSE + RECENT -->
<div class="row hmpg-browse-block">

<!-- SEARCH -->
<div class="col-xs-12">
<div class="h4 lite-header margin-bottom">Find data across research fields, preview metadata, and download files.</div>
<div class="row">
<div class="col-md-5 col-sm-6 col-xs-11">
<div class="search-widget input-group">
<input id="inputDataverseSearch" class="form-control" type="text" placeholder="Search over 75,000 datasets..." onkeydown="if (event.keyCode == 13) document.getElementById('btnDataverseSearch').click();">
<span class="input-group-btn">
<button id="btnDataverseSearch" class="btn btn-default" type="button" onclick="window.location = '/dataverse/root?q=' + document.getElementById('inputDataverseSearch').value;return false;"><span class="glyphicon glyphicon-search"></span> Find</button>
</span>
</div>
</div>
</div>
</div>

<!-- BROWSE SUBJECT -->
<div class="col-xs-12">
<p class="text-muted">Browse dataverses in this repository by subject.</p>
<div class="row margin-bottom">
<div id="dataversesBySubject" class="col-xs-12">

</div>
</div>
</div>

<!-- RECENT CATEGORY -->
<div class="col-xs-12">
<div class="row">
<div class="col-sm-6 col-xs-12 hmpg-recent-col">
<div class="h4 lite-header margin-bottom">Datasets from journal articles</div>

<hr class="col-xs-11 no-margin-top"/>

<!-- JOURNAL RESULTS -->
<div id="journals" class="row col-xs-12">Loading...</div>

<!-- VIEW ALL -->
<div class="row col-xs-12">
<p class="small text-muted"><a href="/dataverse/root?q=%28categoryOfDataverse%3A%22Journal%22%29&types=datasets&sort=dateSort&order=desc">ALL RECENT JOURNAL ACTIVITY</a> <span class="glyphicon glyphicon-chevron-right"></span></p>
</div>
</div>

<div class="col-sm-6 col-xs-12 hmpg-recent-col">
<div class="h4 lite-header margin-bottom">Datasets from research projects, groups and researchers</div>

<hr class="col-xs-11 no-margin-top"/>

<!-- RESEARCHERS RESULTS -->
<div id="researchers" class="row col-xs-12">Loading...</div>

<!-- VIEW ALL -->
<div class="row col-xs-12">
<p class="small text-muted"><a href= "/dataverse/root?q=%28categoryOfDataverse%3A%22Research+Project%22+OR+categoryOfDataverse%3A%22Researcher%22+OR+categoryOfDataverse%3A%22Research+Group%22%29&types=datasets&sort=dateSort&order=desc">ALL RECENT RESEARCHERS ACTIVITY</a> <span class="glyphicon glyphicon-chevron-right"></span></p>
</div>
</div>
</div>
</div>
</div>

<hr/>

<!-- ACTIVITY -->
<div class="row hmpg-activity-block">
<div class="col-xs-12">
<div class="h4 lite-header margin-bottom">Activity</div>
</div>
<div class="col-xs-12 row">
<div class="col-sm-6 col-xs-12">
<p><span class="highlightBold">All Files</span> <span class="h4 lite-header" id="activityAllTimeDatasetsValue"></span> datasets added <span class="h4 lite-header" id="activityAllTimeFilesValue"></span> file downloads</p>
</div>
<div class="col-sm-6 col-xs-12">
<p><span class="highlightBold">Past 30 Days</span> <span class="h4 lite-header" id="activity30DaysDatasetsValue"></span> datasets added <span class="h4 lite-header" id="activity30DaysFilesValue"></span> file downloads</p>
</div>
</div>
</div>

<hr/>

<!-- OTHER LINKS -->
<div class="row hmpg-other-block">
<div class="col-xs-12">
<div class="h4 lite-header margin-bottom">Looking for other online repositories at Harvard?</div>
<p class="text-muted"><a href="https://library.harvard.edu/services-tools/dash" target="_blank">Harvard DASH central, open-access repository</a> <span class="glyphicon glyphicon-chevron-right"></span> &#160;&#160; <a href="https://library.harvard.edu/services-tools/harvard-library-apis-datasets" target="_blank">Other data at Harvard</a> <span class="glyphicon glyphicon-chevron-right"></span></p>
</div>
</div>

<script type="text/javascript">
//<![CDATA[

//switch baseUrl to point to a different server than the local box
var baseUrl = "";

var thumbBaseURL = baseUrl + "/api/datasets/:persistentId/thumbnail" + "?persistentId=";
var metricBaseUrl = baseUrl + "/api/info/metrics/";
var simpleCatSearch = baseUrl + "/api/search?q=*&type=dataset&sort=dateSort&order=desc&fq=categoryOfDataverse:";

function writeRecentDatasetsInDataverses(fqString, resultCount, elm) {
$.get(simpleCatSearch + fqString + "&per_page=" + resultCount, function(jData) {
var resultHtml = "";
jData.data.items.forEach(function(item){
var date = new Date(item.published_at);
resultHtml += "<div class=\"row col-xs-12\">";
resultHtml += "<div class=\"col-xs-2 text-center hmpg-recent-thumb\"><a href=\"/dataset.xhtml?persistentId=" + item.global_id + "\">";
resultHtml += "<object data=\"" + thumbBaseURL + item.global_id + "\" type=\"image/png\"/><span class=\"icon-dataset\"></span></object></div>";
resultHtml += "<div class=\"col-xs-9 col-md-10 hmpg-recent-metadata\"><p><a href=\"/dataset.xhtml?persistentId=" + item.global_id + "\">" + item.name + "</a></p><p class=\"small text-muted\"><a href=\"/dataverse/" + item.identifier_of_dataverse + "\">" + item.name_of_dataverse + "</a> - " + date.toDateString() + "</p></div>";
resultHtml += "<hr class=\"col-xs-12\"/></div>";
});
document.getElementById(elm).innerHTML = resultHtml;
});
}

//For metrics that return simple json with a count
function queryMetricSimple(metricRelPath, month, elm) {
$.get(metricBaseUrl + metricRelPath + month, function(jData) {
var resultCount = jData.data.count;
document.getElementById(elm).innerHTML = resultCount;
});
}

function queryMetricSearch(metricRelPath, month) {
$.get(metricBaseUrl + metricRelPath + month, function(jData) {
var resultCount = jData.data.count;
var roundedDatasetCount = Math.floor(resultCount / 100) * 100;
var dynamicSearchPlaceholder = "Search over " + roundedDatasetCount + " datasets...";
$("#inputDataverseSearch").attr({"placeholder" : dynamicSearchPlaceholder});
});
}

function querySubject(elm) {
$.get(metricBaseUrl + "dataverses/bySubject", function(jData) {
var subArray = [];
var resultHtml = "";
jData.data.forEach(function(item) {
if(item.subject !== "N/A")
subArray.push([item.subject, item.count]);
});
subArray.sort();
subArray.forEach(function(subject){
resultHtml += "<p class=\"browse-subjects\"><a href=\"/dataverse/root?q=&fq0=subject_ss%3A%22" + subject[0] + "%22&types=datasets&sort=dateSort&order=desc\">" + subject[0] + "</a> <span class=\"text-muted\">" + subject[1] + "</span></p>";
});
document.getElementById(elm).innerHTML = resultHtml;
});
}

writeRecentDatasetsInDataverses("(Journal)" , 3, "journals");
writeRecentDatasetsInDataverses("(\"Research+Project\"%20OR%20Researcher%20OR%20\"Research+Group\")" , 3, "researchers");

queryMetricSimple("datasets", "", "activityAllTimeDatasetsValue");
queryMetricSimple("downloads", "", "activityAllTimeFilesValue");

queryMetricSimple("datasets/pastDays", "/30", "activity30DaysDatasetsValue");
queryMetricSimple("downloads/pastDays", "/30", "activity30DaysFilesValue");

querySubject("dataversesBySubject");
queryMetricSearch("datasets", "");

//]]>
</script>
Loading

0 comments on commit 5508277

Please sign in to comment.