diff --git a/pasystem/pasystem-api/api/src/java/org/sakaiproject/pasystem/api/Banners.java b/pasystem/pasystem-api/api/src/java/org/sakaiproject/pasystem/api/Banners.java index 65e351db7de9..03452dd64fa8 100644 --- a/pasystem/pasystem-api/api/src/java/org/sakaiproject/pasystem/api/Banners.java +++ b/pasystem/pasystem-api/api/src/java/org/sakaiproject/pasystem/api/Banners.java @@ -48,7 +48,7 @@ public interface Banners extends Acknowledger { /** * Forget all acknowledgements for the current user. */ - public void clearTemporaryDismissedForUser(String userId); + public void clearAcknowledgementForUser(String userId); public Optional getForId(String uuid); } diff --git a/pasystem/pasystem-impl/impl/src/java/org/sakaiproject/pasystem/impl/acknowledgements/AcknowledgementStorage.java b/pasystem/pasystem-impl/impl/src/java/org/sakaiproject/pasystem/impl/acknowledgements/AcknowledgementStorage.java index 3225f4b750cd..7607c327eda7 100644 --- a/pasystem/pasystem-impl/impl/src/java/org/sakaiproject/pasystem/impl/acknowledgements/AcknowledgementStorage.java +++ b/pasystem/pasystem-impl/impl/src/java/org/sakaiproject/pasystem/impl/acknowledgements/AcknowledgementStorage.java @@ -78,16 +78,15 @@ public Void call(DBConnection db) throws SQLException { } /** - * Forget all temporary acknowledgements created by a user. + * Forget all acknowledgements created by a user. */ - public void clearTemporaryDismissedForUser(String userId) { + public void clearAcknowledgementForUser(String userId) { DB.transaction - ("Delete all temporarily dismissed banners for a user", + ("Delete all acknowledgement for a user", new DBAction() { @Override public Void call(DBConnection db) throws SQLException { - db.run("DELETE FROM " + tableName + " WHERE state = ? AND user_id = ?") - .param(AcknowledgementType.TEMPORARY.dbValue()) + db.run("DELETE FROM " + tableName + " WHERE user_id = ?") .param(userId) .executeUpdate(); diff --git a/pasystem/pasystem-impl/impl/src/java/org/sakaiproject/pasystem/impl/banners/BannerStorage.java b/pasystem/pasystem-impl/impl/src/java/org/sakaiproject/pasystem/impl/banners/BannerStorage.java index e3470d2b3a18..bfbeb321dee1 100644 --- a/pasystem/pasystem-impl/impl/src/java/org/sakaiproject/pasystem/impl/banners/BannerStorage.java +++ b/pasystem/pasystem-impl/impl/src/java/org/sakaiproject/pasystem/impl/banners/BannerStorage.java @@ -265,7 +265,7 @@ private AcknowledgementType calculateAcknowledgementType(String uuid) { } @Override - public void clearTemporaryDismissedForUser(String userId) { - new AcknowledgementStorage(AcknowledgementStorage.NotificationType.BANNER).clearTemporaryDismissedForUser(userId); + public void clearAcknowledgementForUser(String userId) { + new AcknowledgementStorage(AcknowledgementStorage.NotificationType.BANNER).clearAcknowledgementForUser(userId); } } diff --git a/pasystem/pasystem-impl/impl/src/java/org/sakaiproject/pasystem/impl/rest/PASystemEntityProvider.java b/pasystem/pasystem-impl/impl/src/java/org/sakaiproject/pasystem/impl/rest/PASystemEntityProvider.java index e980254e015d..03cdeeffed18 100644 --- a/pasystem/pasystem-impl/impl/src/java/org/sakaiproject/pasystem/impl/rest/PASystemEntityProvider.java +++ b/pasystem/pasystem-impl/impl/src/java/org/sakaiproject/pasystem/impl/rest/PASystemEntityProvider.java @@ -146,7 +146,7 @@ public String clearBannerAcknowledgements(EntityView view, Map p return result.toJSONString(); } - paSystem.getBanners().clearTemporaryDismissedForUser(userId); + paSystem.getBanners().clearAcknowledgementForUser(userId); result.put("status", "SUCCESS"); return result.toJSONString(); diff --git a/pasystem/pasystem-tool/tool/src/java/org/sakaiproject/pasystem/tool/handlers/BannersHandler.java b/pasystem/pasystem-tool/tool/src/java/org/sakaiproject/pasystem/tool/handlers/BannersHandler.java index b17e473335b5..b16d8b063ab7 100644 --- a/pasystem/pasystem-tool/tool/src/java/org/sakaiproject/pasystem/tool/handlers/BannersHandler.java +++ b/pasystem/pasystem-tool/tool/src/java/org/sakaiproject/pasystem/tool/handlers/BannersHandler.java @@ -37,6 +37,8 @@ import org.sakaiproject.pasystem.api.Banner; import org.sakaiproject.pasystem.api.PASystem; import org.sakaiproject.pasystem.tool.forms.BannerForm; +import org.sakaiproject.user.api.User; +import org.sakaiproject.user.cover.UserDirectoryService; /** * A handler for creating and updating banners in the PA System administration tool. @@ -89,6 +91,12 @@ protected void handleCreateOrUpdate(HttpServletRequest request, Map