diff --git a/dataverse-webapp/src/main/java/edu/harvard/iq/dataverse/bannersandmessages/MessagesAndBannersFragment.java b/dataverse-webapp/src/main/java/edu/harvard/iq/dataverse/bannersandmessages/MessagesAndBannersFragment.java index 25879b975e..b5a1320267 100644 --- a/dataverse-webapp/src/main/java/edu/harvard/iq/dataverse/bannersandmessages/MessagesAndBannersFragment.java +++ b/dataverse-webapp/src/main/java/edu/harvard/iq/dataverse/bannersandmessages/MessagesAndBannersFragment.java @@ -12,17 +12,15 @@ import javax.inject.Named; import java.io.IOException; import java.util.List; -import java.util.logging.Logger; /** * Responsible for displaying messages and banners across the dataverse. */ +@SuppressWarnings("serial") @ViewScoped @Named("MessagesAndBannersFragment") public class MessagesAndBannersFragment implements java.io.Serializable { - private static final Logger logger = Logger.getLogger(MessagesAndBannersFragment.class.getCanonicalName()); - @EJB private DataverseTextMessageServiceBean textMessageService; @@ -34,17 +32,19 @@ public class MessagesAndBannersFragment implements java.io.Serializable { public List textMessages(Long dataverseId) { - return textMessageService.getTextMessagesForDataverse(dataverseId, dataverseSession.getLocaleCode()); + return textMessageService.getTextMessagesForDataverse(dataverseId, + dataverseSession.getLocaleCode()); } public List banners(Long dataverseId) { - return bannerDAO.getBannersForDataverse(dataverseId, dataverseSession.getLocaleCode()); + return bannerDAO.getBannersForDataverse(dataverseId, + dataverseSession.getLocaleCode()); } public void redirect(String link) throws IOException { if (!link.startsWith("http")) { - link = "http://" + link; + link = "http://".concat(link); } FacesContext.getCurrentInstance().getExternalContext().redirect(link); } diff --git a/dataverse-webapp/src/main/java/edu/harvard/iq/dataverse/bannersandmessages/messages/DataverseTextMessageServiceBean.java b/dataverse-webapp/src/main/java/edu/harvard/iq/dataverse/bannersandmessages/messages/DataverseTextMessageServiceBean.java index 36c9fab1bb..c886774223 100644 --- a/dataverse-webapp/src/main/java/edu/harvard/iq/dataverse/bannersandmessages/messages/DataverseTextMessageServiceBean.java +++ b/dataverse-webapp/src/main/java/edu/harvard/iq/dataverse/bannersandmessages/messages/DataverseTextMessageServiceBean.java @@ -119,7 +119,8 @@ public List getTextMessagesForDataverse(Long dataverseId, String localeC public List fetchAllTextMessagesForDataverse(long dataverseId) { return em.createQuery("select dtm FROM DataverseTextMessage as dtm " + "join fetch DataverseLocalizedMessage " + - "where dtm.dataverse.id = :dataverseid") + "where dtm.dataverse.id = :dataverseid", + DataverseTextMessage.class) .setParameter("dataverseid", dataverseId) .getResultList(); } @@ -136,7 +137,8 @@ public List fetchAllTextMessagesForDataverse(long datavers public List fetchTextMessagesForDataverseWithPaging(long dataverseId, int firstResult, int maxResult) { return em.createQuery("select dtm FROM DataverseTextMessage as dtm " + "join fetch DataverseLocalizedMessage " + - "where dtm.dataverse.id = :dataverseid order by dtm.id DESC ") + "where dtm.dataverse.id = :dataverseid order by dtm.id DESC ", + DataverseTextMessage.class) .setParameter("dataverseid", dataverseId) .setFirstResult(firstResult) .setMaxResults(maxResult) diff --git a/dataverse-webapp/src/main/webapp/text-messagesAndBanners.xhtml b/dataverse-webapp/src/main/webapp/text-messagesAndBanners.xhtml index 5799757d60..2fa6d0a6f1 100644 --- a/dataverse-webapp/src/main/webapp/text-messagesAndBanners.xhtml +++ b/dataverse-webapp/src/main/webapp/text-messagesAndBanners.xhtml @@ -2,7 +2,8 @@ xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:jsf="http://xmlns.jcp.org/jsf" - xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui"> + xmlns:c="http://java.sun.com/jsp/jstl/core" + xmlns:p="http://primefaces.org/ui"> @@ -19,8 +20,11 @@
- - +