Package org.sakaiproject.signup.logic
Interface SakaiFacade
-
public interface SakaiFacadeThis is an interface to provides all necessary methods, which are depend on the Sakai Services. This will allow the separation of Signup Tool and the Sakai Tools
-
-
Field Summary
Fields Modifier and Type Field Description static StringGROUP_PREFIXstatic StringGROUP_PROP_SIGNUP_IGNOREstatic StringGROUP_PROP_SITEINFO_VISIBLEstatic StringNO_LOCATIONstatic StringREALM_ID_FOR_LOGIN_REQUIRED_ONLYstatic StringSIGNUP_ATTENDstatic StringSIGNUP_ATTEND_ALLstatic StringSIGNUP_CREATE_GROUPstatic StringSIGNUP_CREATE_GROUP_ALLstatic StringSIGNUP_CREATE_SITECan create meetings in site and groups in that site*static StringSIGNUP_DELETE_GROUPstatic StringSIGNUP_DELETE_GROUP_ALLstatic StringSIGNUP_DELETE_SITEstatic StringSIGNUP_UPDATE_GROUPstatic StringSIGNUP_UPDATE_GROUP_ALLstatic StringSIGNUP_UPDATE_SITEstatic StringSIGNUP_VIEWstatic StringSIGNUP_VIEW_ALLstatic StringSTUDENT_ROLE_ID
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddUsersToGroup(Collection<String> userIds, String siteId, String groupId, String timeslottoGroup)Add the users to the given group in the given sitebooleancheckForGroup(String siteId, String groupId)Check if a group with the given id existsbooleancheckForUser(String userId)Does this user exist in the system?StringcreateGroup(String siteId, String title, String description, List<String> userUuids)Create a group in the specified site with the given title and description and optionally, a list of user uuids to populate it.CalendargetAdditionalCalendar(String siteId)List<SignupUser>getAllPossbileCoordinatorsOnFastTrack(SignupMeeting meeting)get all coordinators, who have create meeting permission in the event/meeting This method is much efficient and fast.List<SignupUser>getAllPossibleAttendees(SignupMeeting meeting)get all users, who have permission to attend the meetingList<SignupUser>getAllPossibleCoordinators(SignupMeeting meeting)get all coordinators, who have create meeting permission in the event/meetingList<SignupUser>getAllUsers(SignupMeeting meeting)get all users, who have joined in the event/meetingCalendargetCalendar(String siteId)get Calendar for this specific siteIdCalendargetCalendarById(String calendarId)get Calendar object by calendar unique IdContentHostingServicegetContentHostingService()get a ContentHostingService from one of the Sakai servicesStringgetCurrentLocationId()get current site IdStringgetCurrentPageId()get current pageId,which is an unique idStringgetCurrentUserId()get current userIdFormattedTextgetFormattedText()GroupgetGroup(String siteId, String groupId)get group object accourding to the siteId and groupIdList<String>getGroupMembers(String siteId, String groupId)Get the list of users in a groupStringgetLocationTitle(String locationId)get current site titleServerConfigurationServicegetServerConfigurationService()get ServerConfigurationService objectSignupUsergetSignupUser(SignupMeeting meeting, String userId)get the user, who has permission to attend the meetingSiteServicegetSiteService()set a Sakai SiteServiceStringgetSiteSignupPageId(String siteId)get site-signup pageId,which is an unique id *TimeServicegetTimeService()get a TimeService object from one of the Sakai servicesToolManagergetToolManager()get the ToolManager object.UsergetUser(String userId)get the User objectUsergetUserByEid(String eid)Find a user by their eid.UsergetUserByEmail(String email)Get a user by email address.StringgetUserDisplayLastFirstName(String userId)Get the display name for a user by their unique idStringgetUserDisplayName(String userId)Get the display name for a user by their unique idStringgetUserId(String eid)get internal user idList<String>getUserPublishedSiteIds(String userId)get all the published sites, which user joins inUsergetUserQuietly(String userId)get the User object but do not log any messages.Collection<User>getUsersByEmail(String email)Find users by an email address.List<SignupSite>getUserSites(String userId)get all the sites, which user joins inList<User>getUsersWithPermission(String permission)Get a list of users in the current site that have the given permissionbooleanhasPermissionToCreate(SignupMeeting meeting, String userId)test whether a user has permission to create a meeting in a meetingbooleanisAllowedGroup(String userId, String permission, String siteId, String groupId)Check if this user has access to the group in the sitebooleanisAllowedSite(String userId, String permission, String siteId)Check if this user has access to the sitebooleanisCsvExportEnabled()Is csv export enabled?booleanisUserAdmin(String userId)check to see if the user is AdminvoidpopSecurityAdvisor(SecurityAdvisor advisor)Pop the specified security advisorSecurityAdvisorpushAllowCalendarEdit(Calendar calendar)Allow calendar.revise.any for the current userSecurityAdvisorpushSecurityAdvisor()Standard privileged push for the current userbooleanremoveUserFromGroup(String userId, String siteId, String groupId)Remove the user from the given group in the given sitebooleansynchonizeGroupTitle(String siteId, String groupId, String newTitle)Synchronize the group title if group title has not been modified directly via Site-Info tool
-
-
-
Field Detail
-
NO_LOCATION
static final String NO_LOCATION
- See Also:
- Constant Field Values
-
SIGNUP_VIEW
static final String SIGNUP_VIEW
- See Also:
- Constant Field Values
-
SIGNUP_VIEW_ALL
static final String SIGNUP_VIEW_ALL
- See Also:
- Constant Field Values
-
SIGNUP_ATTEND
static final String SIGNUP_ATTEND
- See Also:
- Constant Field Values
-
SIGNUP_ATTEND_ALL
static final String SIGNUP_ATTEND_ALL
- See Also:
- Constant Field Values
-
SIGNUP_CREATE_SITE
static final String SIGNUP_CREATE_SITE
Can create meetings in site and groups in that site*- See Also:
- Constant Field Values
-
SIGNUP_CREATE_GROUP
static final String SIGNUP_CREATE_GROUP
- See Also:
- Constant Field Values
-
SIGNUP_CREATE_GROUP_ALL
static final String SIGNUP_CREATE_GROUP_ALL
- See Also:
- Constant Field Values
-
SIGNUP_DELETE_SITE
static final String SIGNUP_DELETE_SITE
- See Also:
- Constant Field Values
-
SIGNUP_DELETE_GROUP
static final String SIGNUP_DELETE_GROUP
- See Also:
- Constant Field Values
-
SIGNUP_DELETE_GROUP_ALL
static final String SIGNUP_DELETE_GROUP_ALL
- See Also:
- Constant Field Values
-
SIGNUP_UPDATE_SITE
static final String SIGNUP_UPDATE_SITE
- See Also:
- Constant Field Values
-
SIGNUP_UPDATE_GROUP
static final String SIGNUP_UPDATE_GROUP
- See Also:
- Constant Field Values
-
SIGNUP_UPDATE_GROUP_ALL
static final String SIGNUP_UPDATE_GROUP_ALL
- See Also:
- Constant Field Values
-
STUDENT_ROLE_ID
static final String STUDENT_ROLE_ID
- See Also:
- Constant Field Values
-
REALM_ID_FOR_LOGIN_REQUIRED_ONLY
static final String REALM_ID_FOR_LOGIN_REQUIRED_ONLY
- See Also:
- Constant Field Values
-
GROUP_PREFIX
static final String GROUP_PREFIX
- See Also:
- Constant Field Values
-
GROUP_PROP_SITEINFO_VISIBLE
static final String GROUP_PROP_SITEINFO_VISIBLE
- See Also:
- Constant Field Values
-
GROUP_PROP_SIGNUP_IGNORE
static final String GROUP_PROP_SIGNUP_IGNORE
- See Also:
- Constant Field Values
-
-
Method Detail
-
isUserAdmin
boolean isUserAdmin(String userId)
check to see if the user is Admin- Parameters:
userId- userId the internal user id (not username)- Returns:
- true if the user is Admin role
-
getCurrentUserId
String getCurrentUserId()
get current userId- Returns:
- the current sakai user id (not username)
-
getUserDisplayLastFirstName
String getUserDisplayLastFirstName(String userId)
Get the display name for a user by their unique id- Parameters:
userId- the current sakai user id (not username)- Returns:
- display name (probably firstname lastname) or "----------" (10 hyphens) if none found
-
getUserDisplayName
String getUserDisplayName(String userId)
Get the display name for a user by their unique id- Parameters:
userId- the current sakai user id (not username)- Returns:
- display name (probably lastname,firstname) or "----------" (10 hyphens) if none found
-
getCurrentLocationId
String getCurrentLocationId()
get current site Id- Returns:
- the current location id of the current user
-
getLocationTitle
String getLocationTitle(String locationId)
get current site title- Parameters:
locationId- a unique id which represents the current location of the user (entity reference)- Returns:
- the title for the context or "--------" (8 hyphens) if none found
-
isAllowedSite
boolean isAllowedSite(String userId, String permission, String siteId)
Check if this user has access to the site- Parameters:
userId- the internal user id (not username)permission- function like signup.viewsiteId- site context id- Returns:
- true if the user has access, false otherwise
-
isAllowedGroup
boolean isAllowedGroup(String userId, String permission, String siteId, String groupId)
Check if this user has access to the group in the site- Parameters:
userId- the internal user id (not username)permission- function like signup.create.groupsiteId- site context idgroupId- group context id- Returns:
- true if the user has access, false otherwise
-
getToolManager
ToolManager getToolManager()
get the ToolManager object.- Returns:
- a ToolManager object.
-
getUserPublishedSiteIds
List<String> getUserPublishedSiteIds(String userId)
get all the published sites, which user joins in- Parameters:
userId- userId the internal user id (not username)- Returns:
- a list of SignupSite objects
-
getUserSites
List<SignupSite> getUserSites(String userId)
get all the sites, which user joins in- Parameters:
userId- userId the internal user id (not username)- Returns:
- a list of SignupSite objects
-
getUserId
String getUserId(String eid) throws UserNotDefinedException
get internal user id- Parameters:
eid- a unique id (enterprise Id)- Returns:
- String internal user id
- Throws:
UserNotDefinedException- throw if user is not found
-
getUser
User getUser(String userId)
get the User object- Parameters:
userId- a sakai internal user Id- Returns:
- an User object
-
getUserQuietly
User getUserQuietly(String userId)
get the User object but do not log any messages.- Parameters:
userId- a sakai internal user Id- Returns:
- an User object
-
checkForUser
boolean checkForUser(String userId)
Does this user exist in the system? This only logs at debug level if they don't exist.- Parameters:
userId-- Returns:
- true if exists, false if not
-
getAllPossibleCoordinators
List<SignupUser> getAllPossibleCoordinators(SignupMeeting meeting)
get all coordinators, who have create meeting permission in the event/meeting- Parameters:
meeting- a SignupMeeting object- Returns:
- a list of SignupMeeting objects
-
getAllPossbileCoordinatorsOnFastTrack
List<SignupUser> getAllPossbileCoordinatorsOnFastTrack(SignupMeeting meeting)
get all coordinators, who have create meeting permission in the event/meeting This method is much efficient and fast. It may have extra people, who don't have view permission, which we have not checked. The chances are very small since they are the site instructor/tf- Parameters:
meeting- a SignupMeeting object- Returns:
- a list of SignupMeeting objects
-
hasPermissionToCreate
boolean hasPermissionToCreate(SignupMeeting meeting, String userId)
test whether a user has permission to create a meeting in a meeting- Parameters:
meeting-userId-- Returns:
-
getAllUsers
List<SignupUser> getAllUsers(SignupMeeting meeting)
get all users, who have joined in the event/meeting- Parameters:
meeting- a SignupMeeting object- Returns:
- a list of SignupMeeting objects
-
getAllPossibleAttendees
List<SignupUser> getAllPossibleAttendees(SignupMeeting meeting)
get all users, who have permission to attend the meeting- Parameters:
meeting- a SignupMeeting object- Returns:
- a list of SignupMeeting objects
-
getCalendar
Calendar getCalendar(String siteId) throws PermissionException
get Calendar for this specific siteId- Parameters:
siteId- a unique id which represents the current site- Returns:
- a Calendar object, will return
nullif something went very wrong - Throws:
PermissionException- throw if user has no permission
-
getCalendarById
Calendar getCalendarById(String calendarId) throws PermissionException
get Calendar object by calendar unique Id- Parameters:
calendarId- a unique Calendar Id- Returns:
- a Calendar object, will return
nullif something went very wrong - Throws:
PermissionException- throw if user has no permission
-
getGroup
Group getGroup(String siteId, String groupId) throws IdUnusedException
get group object accourding to the siteId and groupId- Parameters:
siteId- a unique id which represents the current sitegroupId- a unique id which represents the current group- Returns:
- a Group object
- Throws:
IdUnusedException- throw if siteId or groupId is not found
-
getServerConfigurationService
ServerConfigurationService getServerConfigurationService()
get ServerConfigurationService object- Returns:
- a ServerConfigurationService
-
getSiteService
SiteService getSiteService()
set a Sakai SiteService- Returns:
- a SiteService
-
getCurrentPageId
String getCurrentPageId()
get current pageId,which is an unique id- Returns:
- an unique page Id
-
getSiteSignupPageId
String getSiteSignupPageId(String siteId)
get site-signup pageId,which is an unique id *- Parameters:
siteId- a unique site Id- Returns:
- an unique page Id
-
getTimeService
TimeService getTimeService()
get a TimeService object from one of the Sakai services- Returns:
- a TimeService object.
-
getContentHostingService
ContentHostingService getContentHostingService()
get a ContentHostingService from one of the Sakai services- Returns:
- a ContentHostingService object.
-
getSignupUser
SignupUser getSignupUser(SignupMeeting meeting, String userId)
get the user, who has permission to attend the meeting- Parameters:
meeting- a SignupMeeting objectuserId- userId the internal user id (not username)- Returns:
- a SignupUser object
-
getUsersWithPermission
List<User> getUsersWithPermission(String permission)
Get a list of users in the current site that have the given permission- Parameters:
permission- the permission to check- Returns:
- a List of Users that match the criteria
-
getUsersByEmail
Collection<User> getUsersByEmail(String email)
Find users by an email address. This may return multiples so logic is needed to deal with that.- Parameters:
email-- Returns:
- a list of user objects or an empty list if none.
-
getUserByEmail
User getUserByEmail(String email)
Get a user by email address. Only use this if you are certain that there is only one user that matches, as it will only return the first user if there are multiples.- Parameters:
email-- Returns:
- a User or null if no match
-
getUserByEid
User getUserByEid(String eid)
Find a user by their eid.- Parameters:
eid-- Returns:
- a user object or null if not found
-
isCsvExportEnabled
boolean isCsvExportEnabled()
Is csv export enabled? signup.csv.export.enabled=true/false- Returns:
-
pushAllowCalendarEdit
SecurityAdvisor pushAllowCalendarEdit(Calendar calendar)
Allow calendar.revise.any for the current user
-
pushSecurityAdvisor
SecurityAdvisor pushSecurityAdvisor()
Standard privileged push for the current user
-
popSecurityAdvisor
void popSecurityAdvisor(SecurityAdvisor advisor)
Pop the specified security advisor
-
createGroup
String createGroup(String siteId, String title, String description, List<String> userUuids)
Create a group in the specified site with the given title and description and optionally, a list of user uuids to populate it. The title will be prefixed with the constant GROUP_PREFIX- Parameters:
siteId- site to create this group intitle- group titledescription- group descriptionuserIds- list of users to populate the group with, optional.- Returns:
- The groupId
-
addUsersToGroup
boolean addUsersToGroup(Collection<String> userIds, String siteId, String groupId, String timeslottoGroup)
Add the users to the given group in the given site- Parameters:
userIds- Collection of users, could be a single usersiteId- id of the sitegroupId- id of the group- Returns:
- true if users added, false if not
-
removeUserFromGroup
boolean removeUserFromGroup(String userId, String siteId, String groupId)
Remove the user from the given group in the given site- Parameters:
userId- uuid of the usersiteId- id of the sitegroupId- id of the group- Returns:
- true if user removed, false if not
-
getGroupMembers
List<String> getGroupMembers(String siteId, String groupId)
Get the list of users in a group- Parameters:
siteId- id of the sitegroupId- id of the group- Returns:
- list of uuids for users in the group
-
checkForGroup
boolean checkForGroup(String siteId, String groupId)
Check if a group with the given id exists- Parameters:
siteId- id of the sitegroupId- id of the group- Returns:
- true if group exists, false if not.
-
synchonizeGroupTitle
boolean synchonizeGroupTitle(String siteId, String groupId, String newTitle)
Synchronize the group title if group title has not been modified directly via Site-Info tool- Parameters:
siteId- id of the sitegroupId- id of the groupnewTitle- new group title- Returns:
-
getAdditionalCalendar
Calendar getAdditionalCalendar(String siteId) throws PermissionException
- Throws:
PermissionException
-
getFormattedText
FormattedText getFormattedText()
- Returns:
- Returns the FormattedText service for use in cleaning up HTML.
-
-