Skip to content

Commit

Permalink
Merge pull request #4942 from IQSS/4908-publication-date
Browse files Browse the repository at this point in the history
change Publication Year to Publication Date #4908
  • Loading branch information
kcondon authored Aug 13, 2018
2 parents b74f614 + fd22db6 commit 5dbf025
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/main/java/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,8 @@ dataset.message.termsFailure=The dataset terms could not be updated.
dataset.message.publicInstall=File Access - Files are stored on a publicly accessible storage server.
dataset.metadata.publicationDate=Publication Date
dataset.metadata.publicationDate.tip=The publication date of a dataset.
dataset.metadata.publicationYear=Publication Year
dataset.metadata.publicationYear.tip=The publication year of a dataset.
dataset.metadata.persistentId=Dataset Persistent ID
dataset.metadata.persistentId.tip=The unique persistent identifier for a dataset, which can be a Handle or DOI in Dataverse.
file.metadata.persistentId=File Persistent ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ private void addDataverseReleaseDateToSolrDoc(SolrInputDocument solrInputDocumen
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(dataverse.getPublicationDate().getTime());
int YYYY = calendar.get(Calendar.YEAR);
solrInputDocument.addField(SearchFields.PUBLICATION_DATE, YYYY);
solrInputDocument.addField(SearchFields.PUBLICATION_YEAR, YYYY);
}
}

Expand All @@ -1129,7 +1129,7 @@ private void addDatasetReleaseDateToSolrDoc(SolrInputDocument solrInputDocument,
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(dataset.getPublicationDate().getTime());
int YYYY = calendar.get(Calendar.YEAR);
solrInputDocument.addField(SearchFields.PUBLICATION_DATE, YYYY);
solrInputDocument.addField(SearchFields.PUBLICATION_YEAR, YYYY);
solrInputDocument.addField(SearchFields.DATASET_PUBLICATION_DATE, YYYY);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ public class SearchFields {
*/
public static final String TYPE = "dvObjectType";
public static final String NAME_SORT = "nameSort";
public static final String PUBLICATION_DATE = "publicationDate";
// PUBLICATION_YEAR used to be called PUBLICATION_DATE.
public static final String PUBLICATION_YEAR = "publicationDate";
public static final String RELEASE_OR_CREATE_DATE = "dateSort";
/**
* i.e. "Mar 17, 2015"
Expand Down Expand Up @@ -223,8 +224,8 @@ public class SearchFields {
public static final String DATASET_CITATION_HTML = "citationHtml";
public static final String DATASET_DEACCESSION_REASON = "deaccessionReason";
/**
* In contrast to PUBLICATION_DATE, this field applies only to datasets for
* more targeted results for just datasets. The format is YYYY (i.e.
* In contrast to PUBLICATION_YEAR, this field applies only to datasets for
more targeted results for just datasets. The format is YYYY (i.e.
* "2015").
*/
public static final String DATASET_PUBLICATION_DATE = "dsPublicationDate";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public SolrQueryResponse search(DataverseRequest dataverseRequest, Dataverse dat
solrFieldsToHightlightOnMap.put(SearchFields.VARIABLE_NAME, "Variable Name");
solrFieldsToHightlightOnMap.put(SearchFields.VARIABLE_LABEL, "Variable Label");
solrFieldsToHightlightOnMap.put(SearchFields.FILE_TYPE_SEARCHABLE, "File Type");
solrFieldsToHightlightOnMap.put(SearchFields.DATASET_PUBLICATION_DATE, "Publication Date");
solrFieldsToHightlightOnMap.put(SearchFields.DATASET_PUBLICATION_DATE, "Publication Year");
solrFieldsToHightlightOnMap.put(SearchFields.DATASET_PERSISTENT_ID, BundleUtil.getStringFromBundle("advanced.search.datasets.persistentId"));
solrFieldsToHightlightOnMap.put(SearchFields.FILE_PERSISTENT_ID, BundleUtil.getStringFromBundle("advanced.search.files.persistentId"));
/**
Expand Down Expand Up @@ -233,7 +233,7 @@ public SolrQueryResponse search(DataverseRequest dataverseRequest, Dataverse dat
solrQuery.addFacetField(SearchFields.DATAVERSE_CATEGORY);
solrQuery.addFacetField(SearchFields.METADATA_SOURCE);
// solrQuery.addFacetField(SearchFields.AFFILIATION);
solrQuery.addFacetField(SearchFields.PUBLICATION_DATE);
solrQuery.addFacetField(SearchFields.PUBLICATION_YEAR);
// solrQuery.addFacetField(SearchFields.CATEGORY);
// solrQuery.addFacetField(SearchFields.FILE_TYPE_MIME);
// solrQuery.addFacetField(SearchFields.DISTRIBUTOR);
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/search/advanced.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<ui:fragment rendered="#{mdb.id == '1'}">
<div class="form-group">
<label class="col-sm-4 control-label">
<span data-toggle="tooltip" data-placement="auto right" class="tooltiplabel text-info" data-original-title="#{bundle['dataset.metadata.publicationDate.tip']}">
#{bundle['dataset.metadata.publicationDate']}
<span data-toggle="tooltip" data-placement="auto right" class="tooltiplabel text-info" data-original-title="#{bundle['dataset.metadata.publicationYear.tip']}">
#{bundle['dataset.metadata.publicationYear']}
</span>
</label>
<div class="col-sm-6">
Expand Down

0 comments on commit 5dbf025

Please sign in to comment.