forked from sakaiproject/sakai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SAK-30461 Add bullhorns to portal (sakaiproject#3822)
- Loading branch information
1 parent
cbc895a
commit eabdea2
Showing
28 changed files
with
1,430 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
portal/portal-api/api/src/java/org/sakaiproject/portal/api/BullhornService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/********************************************************************************** | ||
* $URL$ | ||
* $Id$ | ||
*********************************************************************************** | ||
* | ||
* Copyright (c) 2005, 2006, 2007, 2008 The Sakai Foundation | ||
* | ||
* Licensed under the Educational Community License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.opensource.org/licenses/ECL-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
**********************************************************************************/ | ||
|
||
package org.sakaiproject.portal.api; | ||
|
||
import java.util.List; | ||
|
||
import org.sakaiproject.portal.beans.BullhornAlert; | ||
import org.sakaiproject.tool.api.Placement; | ||
|
||
/** | ||
* Service for the bullhorn alerts at the top of the portal | ||
* | ||
* @author Adrian Fish <[email protected]> | ||
*/ | ||
public interface BullhornService { | ||
|
||
/** | ||
* Used by the bullhorn alerts code | ||
*/ | ||
public static final String ACADEMIC = "ACADEMIC"; | ||
|
||
/** | ||
* Used by the bullhorn alerts code | ||
*/ | ||
public static final String SOCIAL = "SOCIAL"; | ||
|
||
/** | ||
* @param userId The user to retrieve the alert count for | ||
* @return the number of current social alerts for the specified user | ||
*/ | ||
public int getSocialAlertCount(String userId); | ||
|
||
/** | ||
* @param userId The user to retrieve alerts for | ||
* @return the list of current social alerts for the specified user | ||
*/ | ||
public List<BullhornAlert> getSocialAlerts(String userId); | ||
|
||
/** | ||
* @param userId The user to clear the alerts for | ||
* @return boolean to indicate success | ||
*/ | ||
public boolean clearAllSocialAlerts(String userId); | ||
|
||
/** | ||
* @param userId The user to retrieve the alert count for | ||
* @return the number of current academic alerts for the specified user | ||
*/ | ||
public int getAcademicAlertCount(String userId); | ||
|
||
/** | ||
* @param userId The user to retrieve alerts for | ||
* @return the list of current academic alerts for the specified user | ||
*/ | ||
public List<BullhornAlert> getAcademicAlerts(String userId); | ||
|
||
/** | ||
* @param userId The user to clear the alert for | ||
* @param alertId The alert to clear | ||
* @return boolean to indicate success | ||
*/ | ||
public boolean clearBullhornAlert(String userId, long alertId); | ||
|
||
/** | ||
* @param userId The user to clear the alerts for | ||
* @return boolean to indicate success | ||
*/ | ||
public boolean clearAllAcademicAlerts(String userId); | ||
} |
41 changes: 41 additions & 0 deletions
41
portal/portal-api/api/src/java/org/sakaiproject/portal/beans/BullhornAlert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.sakaiproject.portal.beans; | ||
|
||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
public class BullhornAlert { | ||
|
||
public long id = 0L; | ||
public String from = ""; | ||
public String fromDisplayName = ""; | ||
public String to = ""; | ||
public String event = ""; | ||
public String ref = ""; | ||
public String title = ""; | ||
public String siteId = ""; | ||
public String siteTitle = ""; | ||
public String url = ""; | ||
public long eventDate = 0L; | ||
|
||
public BullhornAlert() { } | ||
|
||
public BullhornAlert(ResultSet rs) { | ||
|
||
try { | ||
id = rs.getLong("ID"); | ||
from = rs.getString("FROM_USER"); | ||
to = rs.getString("TO_USER"); | ||
event = rs.getString("EVENT"); | ||
ref = rs.getString("REF"); | ||
title = rs.getString("TITLE"); | ||
siteId = rs.getString("SITE_ID"); | ||
url = rs.getString("URL"); | ||
eventDate = rs.getTimestamp("EVENT_DATE").getTime(); | ||
} catch (SQLException sqle) { | ||
log.error("Failed to build BullhornAlert from db record", sqle); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
wallPost = \u0020posted on your wall | ||
statusUpdate = \u0020updated their status | ||
postComment = \u0020commented on your post | ||
friendRequest = \u0020sent you a friend request | ||
friendConfirm = \u0020confirmed your friend request | ||
commentCreated = \u0020commented on your post | ||
message = \u0020sent you a message | ||
accept = Accept | ||
ignore = Ignore | ||
view = View | ||
clear = Clear | ||
noAlerts = No alerts | ||
announcement = \u0020added a new announcement "{0}" in "{1}" | ||
assignmentCreated = \u0020created a new assignment "{0}" in "{1}" | ||
assignmentSubmissionGraded = \u0020graded your submission for assignment "{0}" in "{1}" | ||
clearAll = Clear All | ||
unrecognisedAlert = Unrecognised alert | ||
academicCommentCreated = \u0020commented on your post in "{0}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.