Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/DatasetField.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,28 @@ public List<String> getValues_nondisplay()
}
return returnList;
}
/**
* list of values (as opposed to display values).
* used for passing to solr for indexing
*/
public List<String> getDisplayValues() {
List returnList = new ArrayList();
if (!datasetFieldValues.isEmpty()) {
for (DatasetFieldValue dsfv : datasetFieldValues) {
String value = dsfv.getDisplayValue();
if (value != null) {
returnList.add(value);
}
}
} else {
for (ControlledVocabularyValue cvv : controlledVocabularyValues) {
if (cvv != null && cvv.getStrValue() != null) {
returnList.add(cvv.getStrValue());
}
}
}
return returnList;
}

/**
* appears to be only used for sending info to solr; changed to return values
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ public enum DisplayMode {
private String dropBoxSelection = "";
private String deaccessionReasonText = "";
private String displayCitation;
private String displayTitle;
private String deaccessionForwardURLFor = "";
private String showVersionList = "false";
private List<Template> dataverseTemplates = new ArrayList<>();
Expand Down Expand Up @@ -1649,6 +1650,14 @@ public void setDisplayCitation(String displayCitation) {
this.displayCitation = displayCitation;
}

public String getDisplayTitle() {
return displayTitle;
}

public void setDisplayTitle(String displayTitle) {
this.displayTitle = displayTitle;
}

public String getDropBoxSelection() {
return dropBoxSelection;
}
Expand Down Expand Up @@ -2112,6 +2121,8 @@ private String init(boolean initFull) {
JsfHelper.addWarningMessage(retrieveDatasetVersionResponse.getDifferentVersionMessage());//BundleUtil.getStringFromBundle("dataset.message.metadataSuccess"));
}

displayTitle = workingVersion.getTitle();

// init the citation
displayCitation = dataset.getCitation(true, workingVersion, isAnonymizedAccess());
logger.fine("Citation: " + displayCitation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ private List<Path> listCachedFiles() throws IOException {
datasetDirectoryPath = Paths.get(getDatasetDirectory());
}

if (datasetDirectoryPath == null) {
if (datasetDirectoryPath == null) {
throw new IOException("Could not determine the filesystem directory of the parent dataset.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.ArrayList;

import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
Expand All @@ -85,6 +85,7 @@
import jakarta.ejb.EJBException;
import jakarta.ejb.Stateless;
import jakarta.ejb.TransactionAttribute;

import static jakarta.ejb.TransactionAttributeType.REQUIRES_NEW;

import jakarta.inject.Inject;
Expand Down Expand Up @@ -235,7 +236,7 @@ public Future<String> indexDataverse(Dataverse dataverse, boolean processPaths)
solrInputDocument.addField(SearchFields.RELEASE_OR_CREATE_DATE, dataverse.getCreateDate());
}

/* We don't really have harvested dataverses yet;
/* We don't really have harvested dataverses yet;
(I have in fact just removed the isHarvested() method from the Dataverse object) -- L.A.
if (dataverse.isHarvested()) {
solrInputDocument.addField(SearchFields.IS_HARVESTED, true);
Expand Down Expand Up @@ -1060,7 +1061,6 @@ public SolrInputDocuments toSolrDocs(IndexableDataset indexableDataset, Set<Long
if (datasetVersion.isInReview()) {
solrInputDocument.addField(SearchFields.PUBLICATION_STATUS, IN_REVIEW_STRING);
}

CurationStatus status = datasetVersion.getCurrentCurationStatus();
if(status != null && Strings.isNotBlank(status.getLabel())) {
solrInputDocument.addField(SearchFields.CURATION_STATUS, status.getLabel());
Expand Down Expand Up @@ -1305,7 +1305,9 @@ public SolrInputDocuments toSolrDocs(IndexableDataset indexableDataset, Set<Long
solrInputDocument.addField(solrFieldFacetable, topicClassificationTerm);
}
} else {
solrInputDocument.addField(solrFieldFacetable, dsf.getValuesWithoutNaValues());
var values = dsf.getDisplayValues(); // for proper display of facets with &apos;
values.removeAll(Arrays.asList(DatasetField.NA_VALUE));
solrInputDocument.addField(solrFieldFacetable, values);
}
}
}
Expand Down Expand Up @@ -1722,7 +1724,7 @@ public SolrInputDocuments toSolrDocs(IndexableDataset indexableDataset, Set<Long
GlobalId filePid = datafile.getGlobalId();
datafileSolrInputDocument.addField(SearchFields.FILE_PERSISTENT_ID,
(filePid != null) ? filePid.toString() : null);

datafileSolrInputDocument.addField(SearchFields.SUBTREE, dataversePaths);
// datafileSolrInputDocument.addField(SearchFields.HOST_DATAVERSE,
// dataFile.getOwner().getOwner().getName());
Expand All @@ -1743,7 +1745,7 @@ public SolrInputDocuments toSolrDocs(IndexableDataset indexableDataset, Set<Long
datafileSolrInputDocument.addField(SearchFields.VARIABLE_COUNT, variables.size());
datafileSolrInputDocument.addField(SearchFields.OBSERVATIONS, observations);
datafileSolrInputDocument.addField(SearchFields.UNF, dtable.getUnf());


Map<Long, VariableMetadata> variableMap = null;
Collection<VariableMetadata> variablesByMetadata = fileMetadata.getVariableMetadatas();
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@
<div class="row" jsf:rendered="#{empty DatasetPage.editMode}">
<div class="col-xs-12">
<div id="datasetVersionBlock" class="row">
<div id="title-block" class="col-xs-12 margin-bottom-half" jsf:rendered="#{!empty DatasetPage.datasetVersionUI.title.value}">
<h1 id="title">#{DatasetPage.datasetVersionUI.title.value}</h1>
<div id="title-block" class="col-xs-12 margin-bottom-half" jsf:rendered="#{!empty DatasetPage.displayTitle}">
<h1 id="title">#{DatasetPage.displayTitle}</h1>
<div id="title-label-block" class="margin-top-half">
<!-- DATASET Publication Status -->
<h:outputText value="#{bundle['dataset.versionUI.draft']}" styleClass="label label-primary" rendered="#{version.draft}"/>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/search-include-fragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@
<span class="glyphicon glyphicon-new-window text-info pull-right" title="#{bundle.harvested}" jsf:rendered="#{result.harvested}"/>
<span class="icon-dataset text-info pull-right" title="#{bundle.dataset}"/>
<a href="#{!SearchIncludeFragment.rootDv and !result.isInTree ? result.datasetUrl : widgetWrapper.wrapURL(result.datasetUrl)}" target="#{(!SearchIncludeFragment.rootDv and !result.isInTree and widgetWrapper.widgetView) or result.harvested ? '_blank' : ''}">
<h:outputText value="#{result.title}" style="padding:4px 0;" rendered="#{result.titleHighlightSnippet == null}"/>
<h:outputText value="#{result.nameSort}" style="padding:4px 0;" rendered="#{result.titleHighlightSnippet == null}"/>
<h:outputText value="#{result.titleHighlightSnippet}" style="padding:4px 0;" rendered="#{result.titleHighlightSnippet != null}" escape="false"/>
<h:outputText value=" (#{result.entityId})" style="padding:4px 0;" rendered="#{dataverseSession.debug}"/></a>

Expand Down