Skip to content

Commit 016fc9a

Browse files
committed
#8184 hide breadcrumbs/header for anon access
1 parent 81a76ef commit 016fc9a

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

src/main/java/edu/harvard/iq/dataverse/DatasetPage.java

+12-3
Original file line numberDiff line numberDiff line change
@@ -1935,13 +1935,13 @@ public void updateOwnerDataverse() {
19351935
if (selectedHostDataverse != null && selectedHostDataverse.getId() != null) {
19361936
ownerId = selectedHostDataverse.getId();
19371937
dataset.setOwner(selectedHostDataverse);
1938-
logger.info("New host dataverse id: "+ownerId);
1938+
logger.info("New host dataverse id: " + ownerId);
19391939
// discard the dataset already created
19401940
//If a global ID was already assigned, as is true for direct upload, keep it (if files were already uploaded, they are at the path corresponding to the existing global id)
19411941
GlobalId gid = dataset.getGlobalId();
19421942
dataset = new Dataset();
1943-
if(gid!=null) {
1944-
dataset.setGlobalId(gid);
1943+
if (gid != null) {
1944+
dataset.setGlobalId(gid);
19451945
}
19461946

19471947
// initiate from scratch: (isolate the creation of a new dataset in its own method?)
@@ -2287,8 +2287,17 @@ private String init(boolean initFull) {
22872287
JsfHelper.addWarningMessage(message);
22882288
}
22892289
}
2290+
if(isAnonymizedAccess()){
2291+
dataverseHeaderFragment.setBreadcrumbs(new ArrayList<>());
2292+
}
22902293
return null;
22912294
}
2295+
2296+
public void viewActionInitBreadcrumbs(){
2297+
if(!isAnonymizedAccess()){
2298+
dataverseHeaderFragment.initBreadcrumbs(dataset);
2299+
}
2300+
}
22922301

22932302
private void displayWorkflowComments() {
22942303
List<WorkflowComment> comments = workingVersion.getWorkflowComments();

src/main/java/edu/harvard/iq/dataverse/util/BundleUtil.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public static ResourceBundle getResourceBundle(String propertyFileName, Locale c
111111
ClassLoader loader = getClassLoader(filesRootDirectory);
112112
bundle = ResourceBundle.getBundle(propertyFileName, currentLocale, loader);
113113
} catch (MissingResourceException mre) {
114-
logger.warning("No property file named " + propertyFileName + "_" + currentLocale.getLanguage()
114+
logger.fine("No property file named " + propertyFileName + "_" + currentLocale.getLanguage()
115115
+ " found in " + filesRootDirectory + ", using untranslated values");
116116
bundle = ResourceBundle.getBundle("propertyFiles/" + propertyFileName, currentLocale);
117117
}

src/main/java/propertyFiles/Bundle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ dataset.transferUnrestricted=Click Continue to transfer the elligible files.
17211721
dataset.requestAccessToRestrictedFiles=You may request access to any restricted file(s) by clicking the Request Access button.
17221722
dataset.requestAccessToRestrictedFilesWithEmbargo=Embargoed files cannot be accessed during the embargo period. If your selection contains restricted files, you may request access to them by clicking the Request Access button.
17231723
dataset.privateurl.infoMessageAuthor=Privately share this dataset before it is published: {0}
1724-
dataset.privateurl.infoMessageReviewer=This unpublished dataset is being privately shared.
1724+
dataset.privateurl.infoMessageReviewer=You are viewing a preview of this unpublished dataset version.
17251725
dataset.privateurl.header=Unpublished Dataset Preview URL
17261726
dataset.privateurl.tip=To cite this data in publications, use the dataset's persistent ID instead of this URL. For more information about the Preview URL feature, please refer to the <a href="{0}/{1}/user/dataset-management.html#private-url-to-review-unpublished-dataset" title="Preview URL for Reviewing an Unpublished Dataset - Dataverse User Guide" target="_blank">User Guide</a>.
17271727
dataset.privateurl.onlyone=Only one Preview URL can be active for a single dataset.

src/main/webapp/dataset.xhtml

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<ui:param name="dataset" value="#{DatasetPage.dataset}"/>
2121
<ui:param name="version" value="#{DatasetPage.workingVersion}"/>
2222
<ui:param name="locked" value="#{DatasetPage.locked}"/>
23+
<ui:param name="showDataverseHeader" value="#{!DatasetPage.isAnonymizedAccess()}"/>
2324
<ui:param name="showMessagePanel" value="#{true}"/>
2425
<ui:param name="showPublishLink" value="#{DatasetPage.workingVersion == DatasetPage.dataset.latestVersion
2526
and DatasetPage.dataset.latestVersion.versionState=='DRAFT'
@@ -120,7 +121,7 @@
120121
<o:viewParam name="selectTab" value="#{DatasetPage.selectTab}" default="dataFilesTab"/>
121122
<f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
122123
<f:viewAction action="#{DatasetPage.init}" rendered="true"/>
123-
<f:viewAction action="#{dataverseHeaderFragment.initBreadcrumbs(DatasetPage.dataset)}"/>
124+
<f:viewAction action="#{DatasetPage.viewActionInitBreadcrumbs()}"/>
124125
<f:viewAction action="#{EditDatafilesPage.initCreateMode(DatasetPage.editMode, DatasetPage.workingVersion, DatasetPage.uploadInProgress, DatasetPage.newFiles, DatasetPage.uploadedFiles, DatasetPage.selectedFiles)}"/>
125126
</f:metadata>
126127
<h:form id="datasetForm">

0 commit comments

Comments
 (0)