Skip to content

Commit

Permalink
add :GuidesVersion config option #3540
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Dec 21, 2016
1 parent 52e9ec3 commit 55fc128
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 28 deletions.
7 changes: 7 additions & 0 deletions doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,13 @@ Set ``GuidesBaseUrl`` to override the default value "http://guides.dataverse.org

``curl -X PUT -d http://dataverse.example.edu http://localhost:8080/api/admin/settings/:GuidesBaseUrl``

:GuidesVersion
++++++++++++++

Set ``:GuidesVersion`` to override the version number in the URL of guides. For example, rather than http://guides.dataverse.org/en/4.6/user/account.html the version is overriden to http://guides.dataverse.org/en/1234-new-feature/user/account.html in the example below:

``curl -X PUT -d 1234-new-feature http://localhost:8080/api/admin/settings/:GuidesVersion``

:StatusMessageHeader
++++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/DataversePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ public String save() {
if (editMode != null && editMode.equals(EditMode.FEATURED)) {
message = "The featured dataverses for this dataverse have been updated.";
} else {
message = (create) ? BundleUtil.getStringFromBundle("dataverse.create.success", Arrays.asList(settingsWrapper.getGuidesBaseUrl(), systemConfig.getVersion())) : BundleUtil.getStringFromBundle("dataverse.update.success");
message = (create) ? BundleUtil.getStringFromBundle("dataverse.create.success", Arrays.asList(settingsWrapper.getGuidesBaseUrl(), systemConfig.getGuidesVersion())) : BundleUtil.getStringFromBundle("dataverse.update.success");
}
JsfHelper.addSuccessMessage(message);

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/edu/harvard/iq/dataverse/MailServiceBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ private String getMessageTextBasedOnNotification(UserNotification userNotificati
parentDataverseDisplayName,
parentDataverseUrl,
systemConfig.getGuidesBaseUrl(),
systemConfig.getVersion()));
systemConfig.getGuidesVersion()));
logger.fine(dataverseCreatedMessage);
return messageText += dataverseCreatedMessage;
case REQUESTFILEACCESS:
Expand Down Expand Up @@ -393,7 +393,7 @@ private String getMessageTextBasedOnNotification(UserNotification userNotificati
version.getDataset().getOwner().getDisplayName(),
getDataverseLink(version.getDataset().getOwner()),
systemConfig.getGuidesBaseUrl(),
systemConfig.getVersion()
systemConfig.getGuidesVersion()
));
logger.fine(datasetCreatedMessage);
return messageText += datasetCreatedMessage;
Expand Down Expand Up @@ -427,7 +427,7 @@ private String getMessageTextBasedOnNotification(UserNotification userNotificati
case CREATEACC:
String accountCreatedMessage = BundleUtil.getStringFromBundle("notification.email.welcome", Arrays.asList(
systemConfig.getGuidesBaseUrl(),
systemConfig.getVersion()
systemConfig.getGuidesVersion()
));
String optionalConfirmEmailAddon = confirmEmailService.optionalConfirmEmailAddonMsg(userNotification.getUser());
accountCreatedMessage += optionalConfirmEmailAddon;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ public enum Key {
/** Optionally override http://guides.dataverse.org . */
GuidesBaseUrl,
/* zip download size limit */
/** Optionally override version number in guides. */
GuidesVersion,
ZipDownloadLimit,
/* zip upload number of files limit */
ZipUploadFilesLimit,
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,15 @@ private String getGuidesLanguage() {
return saneDefault;
}

public String getGuidesVersion() {
String saneDefault = getVersion();
String guidesVersion = settingsService.getValueForKey(SettingsServiceBean.Key.GuidesVersion, saneDefault);
if (guidesVersion != null) {
return guidesVersion;
}
return saneDefault;
}

/**
* Download-as-zip size limit.
* returns 0 if not specified;
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/dashboard.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<span class="glyphicon glyphicon-info-sign"/>
<h:outputFormat value=" #{bundle['dashboard.card.metadataexport.message']}" escape="false">
<f:param value="#{dataverseServiceBean.findRootDataverse().displayName}"/>
<f:param value="&lt;a href=&#34;#{systemConfig.guidesBaseUrl}/#{systemConfig.version}/api&#34; target=&#34;_blank&#34;&gt;"/>
<f:param value="&lt;a href=&#34;#{systemConfig.guidesBaseUrl}/#{systemConfig.guidesVersion}/api&#34; target=&#34;_blank&#34;&gt;"/>
<f:param value="&lt;/a&gt;"/>
</h:outputFormat>
</p>
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/dataset-widgets.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
<li>
<h:outputFormat value="#{bundle['dataset.widgets.notPublished.how.tip3']}" escape="false">
<f:param value="#{systemConfig.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
</li>
</ul>
<p>
<h:outputFormat value="#{bundle['dataset.widgets.notPublished.getStarted']}" escape="false">
<f:param value="#{systemConfig.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
</p>
</div>
Expand All @@ -52,7 +52,7 @@
<p class="help-block"><span class="glyphicon glyphicon-info-sign"/>
<h:outputFormat value=" #{bundle['dataset.widgets.tip']}" escape="false">
<f:param value="#{systemConfig.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
</p>
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@
<p class="help-block"><span class="glyphicon glyphicon-info-sign"/>&#160;
<h:outputFormat value="#{bundle['dataset.privateurl.tip']}" escape="false">
<f:param value="#{systemConfig.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
</p>
<div>
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/dataverse_header.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</span>
<ul class="dropdown-menu">
<li>
<h:outputLink value="#{settingsWrapper.guidesBaseUrl}/#{systemConfig.version}/user" target="_blank">
<h:outputLink value="#{settingsWrapper.guidesBaseUrl}/#{systemConfig.guidesVersion}/user" target="_blank">
#{bundle['header.guides.user']}
</h:outputLink>
</li>
Expand All @@ -73,7 +73,7 @@
</h:outputLink>
</li>
<li>
<h:outputLink value="#{settingsWrapper.guidesBaseUrl}/#{systemConfig.version}/api" target="_blank">
<h:outputLink value="#{settingsWrapper.guidesBaseUrl}/#{systemConfig.guidesVersion}/api" target="_blank">
<h:outputText value="#{bundle['header.guides.api']}" />
</h:outputLink>
</li>
Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/dataverseuser.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<h:outputText value="#{dataverseServiceBean.findRootDataverse().name}"/>
</o:param>
<o:param>
<a href="#{systemConfig.guidesBaseUrl}/#{systemConfig.version}/user/index.html" title="#{dataverseServiceBean.findRootDataverse().name} #{bundle['dataverse']} #{bundle['header.guides.user']}" target="_blank">#{bundle['header.guides.user']}</a>
<a href="#{systemConfig.guidesBaseUrl}/#{systemConfig.guidesVersion}/user/index.html" title="#{dataverseServiceBean.findRootDataverse().name} #{bundle['dataverse']} #{bundle['header.guides.user']}" target="_blank">#{bundle['header.guides.user']}</a>
</o:param>
<o:param>
<a href="https://demo.dataverse.org">#{bundle['notification.demoSite']}</a>
Expand All @@ -97,7 +97,7 @@
<a href="/dataverse/#{item.theObject.getOwner().getAlias()}" title="#{item.theObject.getOwner().getDisplayName()}">#{item.theObject.getOwner().getDisplayName()}</a>
</o:param>
<o:param>
<a href="#{systemConfig.guidesBaseUrl}/#{systemConfig.version}/user/dataverse-management.html" title="#{bundle['notification.dataverse.management.title']}" target="_blank">#{bundle['header.guides.user']}</a>
<a href="#{systemConfig.guidesBaseUrl}/#{systemConfig.guidesVersion}/user/dataverse-management.html" title="#{bundle['notification.dataverse.management.title']}" target="_blank">#{bundle['header.guides.user']}</a>
</o:param>
</h:outputFormat>
</ui:fragment>
Expand All @@ -111,7 +111,7 @@
<a href="/dataverse/#{item.theObject.getDataset().getOwner().getAlias()}" title="#{item.theObject.getDataset().getOwner().getDisplayName()}">#{item.theObject.getDataset().getOwner().getDisplayName()}</a>
</o:param>
<o:param>
<a href="#{systemConfig.guidesBaseUrl}/#{systemConfig.version}/user/dataset-management.html" title="#{bundle['notification.dataset.management.title']}" target="_blank">#{bundle['header.guides.user']}</a>
<a href="#{systemConfig.guidesBaseUrl}/#{systemConfig.guidesVersion}/user/dataset-management.html" title="#{bundle['notification.dataset.management.title']}" target="_blank">#{bundle['header.guides.user']}</a>
</o:param>
</h:outputFormat>
</ui:fragment>
Expand Down Expand Up @@ -359,7 +359,7 @@
<p class="help-block">
<span class="glyphicon glyphicon-info-sign"/>&#160;
<h:outputFormat value="#{bundle['apitoken.message']}" escape="false">
<f:param value="&lt;a href=&#34;#{systemConfig.guidesBaseUrl}/#{systemConfig.version}/api&#34; target=&#34;_blank&#34;&gt;"/>
<f:param value="&lt;a href=&#34;#{systemConfig.guidesBaseUrl}/#{systemConfig.guidesVersion}/api&#34; target=&#34;_blank&#34;&gt;"/>
<f:param value="&lt;/a&gt;"/>
</h:outputFormat>
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/editFilesFragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<ui:fragment rendered="true">
<h:outputFormat value=" #{bundle['file.selectToAdd.tipMoreInformation']}" escape="false">
<f:param value="#{systemConfig.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
</ui:fragment>
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/harvestclients.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<p>
<h:outputFormat value="#{bundle['harvestclients.noClients.getStarted']}" escape="false">
<f:param value="#{systemConfig.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/harvestsets.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<p>
<h:outputFormat value="#{bundle['harvestserver.noSets.getStarted']}" escape="false">
<f:param value="#{systemConfig.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/loginpage.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<span class="glyphicon glyphicon-info-sign"/>
<h:outputFormat value=" #{bundle['login.institution.blurb']} " escape="false">
<f:param value="#{settingsWrapper.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
<h:outputText value="#{bundle['login.institution.support.beforeLink']} " />
<p:commandLink value="#{bundle['contact.support']}" oncomplete="PF('contactForm').show()" update=":contactDialog" actionListener="#{sendFeedbackDialog.initUserInput}">
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/manage-groups.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<p>
<h:outputFormat value="#{bundle['dataverse.manageGroups.noGroups.getStarted']}" escape="false">
<f:param value="#{systemConfig.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/manage-guestbooks.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<p>
<h:outputFormat value="#{bundle['dataset.manageGuestbooks.noGuestbooks.getStarted']}" escape="false">
<f:param value="#{systemConfig.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/manage-templates.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<p>
<h:outputFormat value="#{bundle['dataset.manageTemplates.noTemplates.getStarted']}" escape="false">
<f:param value="#{systemConfig.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
</p>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/search-include-fragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@
<!--SEARCH ZERO COUNTS-->
<p><h:outputFormat value="#{bundle['dataverse.results.empty.zero']}" escape="false">
<f:param value="#{settingsWrapper.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat></p>
</ui:fragment>
<ui:fragment rendered="#{SearchIncludeFragment.facetCountDataverses gt 0 or SearchIncludeFragment.facetCountDatasets gt 0 or SearchIncludeFragment.facetCountFiles gt 0}">
<!--SEARCH HIDDEN-->
<p><h:outputFormat value="#{bundle['dataverse.results.empty.hidden']}" escape="false">
<f:param value="#{settingsWrapper.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat></p>
</ui:fragment>
<ui:fragment rendered="#{SearchIncludeFragment.errorFromSolr != null}">
Expand Down Expand Up @@ -299,7 +299,7 @@
<p>
<h:outputFormat value="#{dataverseRedirectPage == 'dataverseuser.xhtml' ? bundle['account.results.empty.browse.loggedin.perms.zero'] : bundle['dataverse.results.empty.browse.loggedin.perms.zero']}" escape="false">
<f:param value="#{settingsWrapper.guidesBaseUrl}"/>
<f:param value="#{systemConfig.version}"/>
<f:param value="#{systemConfig.guidesVersion}"/>
</h:outputFormat>
</p>
</ui:fragment>
Expand Down
Loading

0 comments on commit 55fc128

Please sign in to comment.