public interface SakaiProxy
| Modifier and Type | Method and Description |
|---|---|
Site |
addSite(String id,
String type)
Add a new site.
|
boolean |
checkForSite(String siteId)
Check if the given siteid is valid
|
boolean |
checkForUser(String userId)
Check if a user with the given internal id (ie 6ec73d2a-b4d9-41d2-b049-24ea5da03fca) exists
|
boolean |
checkForUserByEid(String eid)
Check if a user with the given eid (ie jsmith26) exists
|
SakaiPerson |
createSakaiPerson(String userId)
Create a new persistable SakaiPerson object for a user
|
String |
createUuid()
Get a UUID from the IdManager
|
boolean |
currentUserMatchesRequest(String userUuid)
Convenience method to check if the user making a request is the same as the current user
|
String |
ensureUuid(String userId)
Convenience method to ensure the given userId(eid or internal id) is returned as a valid uuid.
|
List<String> |
getAcademicEntityConfigurationSet()
Gets the profile2.profile.entity.set.academic list of properties that should be used in the academic profile view.
|
List<String> |
getActiveUsers(List<String> userUuids)
Get the list of users with active Sakai sessions, given the supplied list of userIds.
|
String |
getCurrentSiteId()
Get current siteid
|
String |
getCurrentToolTitle()
Get the title of the current tool.
|
User |
getCurrentUser()
Get current user
|
String |
getCurrentUserId()
Get current user id
|
String |
getDirectUrlToProfileComponent(String userId,
String component,
Map<String,String> extraParams)
Creates a direct URL to a component (profile, messages etc) of a user's profile page on their My Workspace
|
String |
getDirectUrlToProfileComponent(String viewerUuid,
String viewedUuid,
String component,
Map<String,String> extraParams)
Creates a direct URL to a component (profile, messages etc) of a user's profile page
from another user's My Workspace.
|
String |
getDirectUrlToUserProfile(String userId,
String extraParams)
Deprecated.
|
String |
getFullPortalUrl()
Gets the full portal url by adding getServerUrl() and getPortalPath() together This WILL work outside the portal context so safe to
use from an entityprovider
|
List<String> |
getInvisibleUsers()
Gets the profile2.invisible.users List for user's that should never show in searches or connection lists
|
Long |
getLastEventTimeForUser(String userUuid)
Get the last event time for the user.
|
Map<String,Long> |
getLastEventTimeForUsers(List<String> userUuids)
Get the last event time for each of the given users
|
int |
getMaxProfilePictureSize()
Get the maximum filesize that can be uploaded (profile2.picture.max=2)
|
int |
getMaxSearchResults()
Get the profile2.search.maxSearchResults value from sakai.properties
|
int |
getMaxSearchResultsPerPage()
Get the profile2.search.maxSearchResultsPerPage value from sakai.properties
|
List<String> |
getMinimalEntityConfigurationSet()
Gets the profile2.profile.entity.set.minimal list of properties that should be used in the minimal profile view.
|
int |
getNamePronunciationDuration()
Returns the name pronunciation duration in seconds
|
String |
getNamePronunciationExamplesLink()
Returns the name pronunciation examples link
|
String |
getOfficialImageAttribute()
Gets the value of the profile2.official.image.attribute from sakai.properties If not set, defaults to
ProfileConstants.USER_PROPERTY_JPEG_PHOTO
This should be specified if profile2.official.image.source=provided
|
String |
getOfficialImagesDirectory()
Gets the value of the profile2.official.image.directory attribute from sakai.properties.
|
String |
getOfficialImagesFileSystemPattern()
Get the value of the profile2.official.image.directory.pattern attribute from sakai.properties.
|
String |
getOfficialImageSource()
Gets the value of the profile2.official.image.source attribute from sakai.properties.
|
HashMap<String,Object> |
getOverriddenPrivacySettings()
Gets the set of sakai.properties that can override the built in defaults.
|
String |
getPortalPath()
Gets the portal path, generally /portal unless override in sakai.properties
|
String |
getPortalUrl()
Gets the portalUrl configuration parameter (ie http://sakai.lancs.ac.uk/portal) Will not work outside of /portal context (ie won't
work from an entityprovider)
|
String |
getProfileGalleryImagePath(String userId,
String imageId)
Returns the gallery resource path for the specified user and image.
|
String |
getProfileGalleryThumbnailPath(String userId,
String thumbnailId)
Returns the gallery resource path for the specified user and thumbnail.
|
String |
getProfileImageResourcePath(String userId,
int type)
Get the location for a profileImage given the user and type
|
String |
getProfileImportCsvPath()
Get the path to the CSV file to import, specified by the profile2.import.csv property
|
int |
getProfilePictureType()
Get the profile2.picture.type setting in sakai.properties
Possible values for the sakai property are 'upload', 'url', 'official' and 'gravatar'.
|
MimeTypeByteArray |
getResource(String resourceId)
Retrieve a resource from ContentHosting with byte[] and mimetype
|
SakaiPerson |
getSakaiPerson(String userId)
Get a SakaiPerson for a user
|
String |
getSakaiPersonImageUrl(String userId)
Get a SakaiPerson image URL for a user.
|
byte[] |
getSakaiPersonJpegPhoto(String userId)
Get a SakaiPerson Jpeg photo for a user.
|
SakaiPerson |
getSakaiPersonPrototype()
Get a SakaiPerson prototype if they don't have a profile.
|
String |
getServerConfigurationParameter(String key,
String def)
Generic method to get a configuration parameter from sakai.properties
|
String |
getServerName()
Get the DNS name of this Sakai server (ie sakai.lancs.ac.uk)
|
String |
getServerUrl()
Gets the serverUrl configuration parameter (http://sakai.lancs.ac.uk:8080)
|
String |
getServiceName()
Get the name of this Sakai installation (ie Sakai@Lancs)
|
Site |
getSite(String siteId)
Return a reference to the specified site.
|
Tool |
getTool(String id)
Returns a reference to the specified Sakai tool.
|
List<String> |
getToolsRequired(String category)
Returns a list of the tool types required for the specified site type.
|
String |
getTwitterSource()
Get the profile2.integration.twitter.source parameter
See here: http://bugs.sakaiproject.org/confluence/display/PROFILE/Profile2
|
User |
getUserById(String userId)
Get a user
|
String |
getUserDisplayName(String userId)
Get displayname of a given userid (internal id)
|
String |
getUserEid(String userId)
Convert internal userid to eid (jsmith26)
|
String |
getUserEmail(String userId)
Get email address for a given userid (internal id)
|
String |
getUserFirstName(String userId)
Get firstname of a given userid (internal id)
|
String |
getUserHomeUrl()
Get the URL to the current user's my workspace
|
String |
getUserIdForEid(String eid)
Convert eid to internal userid
|
String |
getUserLastName(String userId)
Get lastname of a given userid (internal id)
|
User |
getUserQuietly(String userId)
Get the User object for the given userId.
|
List<User> |
getUsers(List<String> userUuids)
Get a list of Users for the given userIds
|
List<Site> |
getUserSites()
Return all user sites for the current user (i.e. worksites that the user has at least 'access' permission to).
|
String |
getUserType(String userId)
Get the type of this user's account
|
List<String> |
getUuids(List<User> users)
Get a list of uuids for each of the given Users
|
boolean |
isAccountUpdateAllowed(String userId)
Check if a user is allowed to update their account.
|
boolean |
isAdminUser()
Is the current user the admin user?
|
boolean |
isBusinessProfileEnabled()
Is the profile2.profile.business.enabled flag set in sakai.properties?
|
boolean |
isConnectionAllowedBetweenUserTypes(String requestingUserType,
String targetUserType)
Gets the list of usertypes from profile2.allowed.connection.usertypes.TYPE.
|
boolean |
isConnectionsEnabledGlobally()
Is the profile2.connections.enabled flag set in sakai.properties?
|
boolean |
isGoogleIntegrationEnabledGlobally()
Is the profile2.integration.google.enabled flag set to true in sakai.properties?
|
boolean |
isGravatarImageEnabledGlobally()
Is profile2.gravatar.image.enabled true?
|
boolean |
isInterestsProfileEnabled()
Is the profile2.profile.interests.enabled flag set in sakai.properties?
|
boolean |
isLoggedIn()
Helper to check if the current user is logged in
|
boolean |
isMenuEnabledGlobally()
Is the profile2.menu.enabled flag set in sakai.properties?
|
boolean |
isMessagingEnabledGlobally()
Is the profile2.messaging.enabled flag set in sakai.properties?
|
boolean |
isMyKudosEnabledGlobally()
Is the profile2.myKudos.enabled flag set in sakai.properties?
|
boolean |
isNamePronunciationProfileEnabled()
Is the profile2.profile.name.pronunciation.enabled flag set in sakai.properties?
|
boolean |
isOfficialImageEnabledGlobally()
Is profile2.official.image.enabled true?
|
boolean |
isOnlineStatusEnabledGlobally()
Is the profile2.onlineStatus.enabled flag set in sakai.properties?
|
boolean |
isPreferenceEnabledGlobally()
Is the profile2.preference.enabled flag set in sakai.properties?
|
boolean |
isPrivacyChangeAllowedGlobally()
Is the profile2.privacy.change.enabled flag set in sakai.properties?
|
boolean |
isPrivacyEnabledGlobally()
Is the profile2.privacy.enabled flag set in sakai.properties?
|
boolean |
isProfileConversionEnabled()
Is the profile2.convert flag set in sakai.properties?
|
boolean |
isProfileFieldsEnabled()
Is the profile2.profile.fields.enabled flag set in sakai.properties?
|
boolean |
isProfileGalleryEnabledGlobally()
Is the profile2.gallery.enabled flag set in sakai.properties?
|
boolean |
isProfileImageImportEnabled()
Is the profile2.import.images flag set in sakai.properties?
|
boolean |
isProfileImportEnabled()
Is the profile2.import flag set in sakai.properties?
|
boolean |
isProfilePictureChangeEnabled()
Is the profile2.picture.change.enabled flag set in sakai.properties?
|
boolean |
isProfileStatusEnabled()
Is the profile2.profile.status.enabled flag set in sakai.properties?
|
boolean |
isSearchEnabledGlobally()
Is the profile2.search.enabled flag set in sakai.properties?
|
boolean |
isSocialProfileEnabled()
Is the profile2.profile.social.enabled flag set in sakai.properties?
|
boolean |
isStaffProfileEnabled()
Is the profile2.profile.staff.enabled flag set in sakai.properties?
|
boolean |
isStudentProfileEnabled()
Is the profile2.profile.student.enabled flag set in sakai.properties?
|
boolean |
isSuperUser()
Is the current user a superUser?
|
boolean |
isSuperUserAndProxiedToUser(String userId)
Is the current user a superUser and are they performing an action on another user's profile?
|
boolean |
isTwitterIntegrationEnabledGlobally()
Is the profile2.integration.twitter.enabled flag set in sakai.properties?
|
boolean |
isUserActive(String userUuid)
Does the user have a current Sakai session
|
boolean |
isUserAllowedAddSite(String userUuid)
Does user have site.add permission?
|
boolean |
isUserAllowedInSite(String userId,
String permission,
String siteId)
Generic method to check if user has permission in site
|
boolean |
isUserMyWorkspace(String siteId)
Check if specified site is a My Workspace site
|
boolean |
isUsingNormalPortal()
Are we using the normal /portal?
|
boolean |
isUsingOfficialImageButAlternateSelectionEnabled()
Checks if the conditions are appropriate for a user to be able to select whether to use the official image or an alternate of their
choice
|
boolean |
isWallDefaultProfilePage()
Is the profile2.wall.default flag set in sakai.properties?
|
boolean |
isWallEnabledGlobally()
Deprecated.
|
void |
postEvent(String event,
String reference,
boolean modify)
Post an event to Sakai
|
boolean |
removeResource(String resourceId)
Removes the specified resource.
|
boolean |
saveFile(String fullResourceId,
String userId,
String fileName,
String mimeType,
byte[] fileData)
Save a file to CHS
|
boolean |
saveSite(Site site)
Save an existing site.
|
List<User> |
searchExternalUsers(String search)
Search UserDirectoryService for externally provided users that match in name or email.
|
List<User> |
searchUsers(String search)
Search UserDirectoryService for users that match in name or email.
|
void |
sendEmail(List<String> userIds,
String emailTemplateKey,
Map<String,String> replacementValues)
Sends an email to a list of users using the email template and replacement values supplied
|
void |
sendEmail(String userId,
String emailTemplateKey,
Map<String,String> replacementValues)
Sends an email to a single user using the email template and replacement values supplied
|
void |
sendEmail(String userId,
String subject,
String message)
Send an email message.
|
boolean |
toggleProfileLocked(String userId,
boolean locked)
Toggle a profile's locked status.
|
void |
updateEmailForUser(String userId,
String email)
Updates a user's email address If the user is a provided user (ie from LDAP) this will probably fail so only internal accounts can be
updated.
|
void |
updateNameForUser(String userId,
String firstName,
String lastName)
Updates a user's name If the user is a provided user (ie from LDAP) this will probably fail so only internal accounts can be updated.
|
boolean |
updateSakaiPerson(SakaiPerson sakaiPerson)
Update a SakaiPerson object in the db.
|
SiteService.SiteTitleValidationStatus |
validateSiteTitle(String orig,
String stripped)
Given the original and stripped site titles, determine that validation status of the stripped string.
|
String getCurrentSiteId()
String getCurrentUserId()
User getCurrentUser()
String getUserDisplayName(String userId)
String getUserFirstName(String userId)
String getUserLastName(String userId)
String getUserEmail(String userId)
boolean checkForUser(String userId)
userId - boolean checkForUserByEid(String eid)
userId - boolean isSuperUser()
boolean isAdminUser()
boolean isSuperUserAndProxiedToUser(String userId)
userId - - userId of other userString getUserType(String userId)
userId - User getUserById(String userId)
userId - internal user idUser getUserQuietly(String userId)
This will not log errors so that we can quietly use it to check if a User exists for a given profile, ie in a search result, for example.
userId - String getCurrentToolTitle()
List<User> getUsers(List<String> userUuids)
userUuids - uuidsList<String> getUuids(List<User> users)
users - UsersSakaiPerson getSakaiPerson(String userId)
userId - byte[] getSakaiPersonJpegPhoto(String userId)
Returns null if nothing found.
userId - String getSakaiPersonImageUrl(String userId)
Returns null if nothing found.
userId - SakaiPerson getSakaiPersonPrototype()
This is not persistable so should only be used for temporary views. Use createSakaiPerson if need persistable object for saving a profile.
userId - SakaiPerson createSakaiPerson(String userId)
userId - boolean updateSakaiPerson(SakaiPerson sakaiPerson)
If you are doing this from the UI you should use the ProfileLogic.updateUserProfile method instead as it will also handle any
email notifications that may be required.
We keep this because for direct actions like converting profiles etc we dont need email notifications.
sakaiPerson - int getMaxProfilePictureSize()
String getProfileGalleryImagePath(String userId, String imageId)
userId - the ID of the user.imageId - the ID of the image.String getProfileGalleryThumbnailPath(String userId, String thumbnailId)
userId - the ID of the user.imageId - the ID of the thumbnail.String getProfileImageResourcePath(String userId, int type)
userId - type - boolean saveFile(String fullResourceId, String userId, String fileName, String mimeType, byte[] fileData)
fullResourceId - userId - fileName - mimeType - fileData - MimeTypeByteArray getResource(String resourceId)
resourceId - the full resourceId of the fileboolean removeResource(String resourceId)
resourceId - the ID of the resource to remove.true if the resource is successfully removed, false if the remove operation fails.List<User> searchUsers(String search)
search - search string.List<User> searchExternalUsers(String search)
search - search string.void postEvent(String event, String reference, boolean modify)
event - name of eventreference - referencemodify - true if something changed, false if just accessvoid sendEmail(String userId, String subject, String message)
userId - userId to send the message tosubject - subject of messagemessage - complete with newlines and any links.void sendEmail(List<String> userIds, String emailTemplateKey, Map<String,String> replacementValues)
users - list of userIds to send to - already cleaned up for their email preferencesemailTemplateKey - the email templatevoid sendEmail(String userId, String emailTemplateKey, Map<String,String> replacementValues)
user - userId to send to - already cleaned up for their email preferencesemailTemplateKey - the email templateString getServiceName()
String getPortalUrl()
String getServerUrl()
String getServerName()
String getUserHomeUrl()
String getPortalPath()
boolean isUsingNormalPortal()
String getFullPortalUrl()
void updateEmailForUser(String userId, String email)
userId - uuid of the useremail - void updateNameForUser(String userId, String firstName, String lastName)
userId - uuid of the useremail - @Deprecated String getDirectUrlToUserProfile(String userId, String extraParams)
userId - uuid of the userextraParams - any extra params to add to the query stringString getDirectUrlToProfileComponent(String userId, String component, Map<String,String> extraParams)
userId - uuid of the usercomponent - - currently only 'viewprofile' is supported.extraParams - a map of params that each component may need, used to build the URLString getDirectUrlToProfileComponent(String viewerUuid, String viewedUuid, String component, Map<String,String> extraParams)
viewerUuid - uuid of the viewing userviewedUuid - uuid of the user being viewedcomponent - - currently only 'viewprofile' is supported.extraParams - a map of params that each component may need, used to build the URLboolean isAccountUpdateAllowed(String userId)
userId - boolean isBusinessProfileEnabled()
false.true if the profile2.profile.business.enabled flag is set, otherwise returns false.@Deprecated boolean isWallEnabledGlobally()
false.
DEPRECATED: UNLESS THERE IS AN EXPRESSED DESIRE FOR THIS FUNCTIONALITY THE WALL WILL BE REMOVED FOR 13.true if the profile2.wall.enabled flag is set, otherwise returns false.boolean isWallDefaultProfilePage()
false.true if the profile2.wall.default flag is set, otherwise returns false.boolean isProfileConversionEnabled()
This will convert profiles from the original Profile tool in Sakai, to Profile2 format. Any images that were uploaded via various methods will be placed into Sakai's ContentHostingSystem and thumbnails generated for use in various parts of Profile2.
boolean isProfileImportEnabled()
This will import profiles from a csv file specified by the profile2.import.csv property
String getProfileImportCsvPath()
boolean isTwitterIntegrationEnabledGlobally()
Depending on this setting, the UI will allow a user to input their Twitter settings and their status updates will be sent to Twitter.
String getTwitterSource()
boolean isProfileGalleryEnabledGlobally()
true.true by default.boolean isProfilePictureChangeEnabled()
Depending on this setting, users will be able to upload their own image. This can be useful to disable for institutions which may provide official photos for students.
int getProfilePictureType()
Possible values for the sakai property are 'upload', 'url', 'official' and 'gravatar'. If not set, defaults to 'upload'.
This returns an int which matches one of: ProfileConstants.PICTURE_SETTING_UPLOAD, ProfileConstants.PICTURE_SETTING_URL, ProfileConstants.PICTURE_SETTING_OFFICIAL, ProfileConstants.PICTURE_SETTINGS_GRAVATAR.
Depending on this setting, Profile2 will decide how it retrieves a user's profile image, and the method by which users can add their own image. ie by uploading their own image, providing a URL, not at all (for official), or creating a gravatar URL
List<String> getAcademicEntityConfigurationSet()
List<String> getMinimalEntityConfigurationSet()
String ensureUuid(String userId)
External integrations must pass input through this method, where the input can be either form, since all data is keyed on the internal user id.
userId - boolean currentUserMatchesRequest(String userUuid)
userUuid - uuid to check against current userboolean isPrivacyChangeAllowedGlobally()
Allows an institution to lock down privacy changes as some things need to be never changed. Generally should coupled with the sakai.properties that override the default privacy settings
HashMap<String,Object> getOverriddenPrivacySettings()
List<String> getInvisibleUsers()
boolean isConnectionAllowedBetweenUserTypes(String requestingUserType, String targetUserType)
This defines what user types can connect to each other. The requestingUserType is appended to the property string and the list retrieved. If targetUserType is in the list, they can connect (true). If not, false.
If the property does not exist for that userType, they can connect, to maintain backward compatibility and keep it open.
requestingUserType - targetUserType - boolean toggleProfileLocked(String userId, boolean locked)
userId - locked - boolean isOfficialImageEnabledGlobally()
boolean isUsingOfficialImageButAlternateSelectionEnabled()
String getOfficialImageSource()
String getOfficialImagesDirectory()
String getOfficialImagesFileSystemPattern()
String getOfficialImageAttribute()
String createUuid()
boolean isUserActive(String userUuid)
userUuid - user to checkList<String> getActiveUsers(List<String> userUuids)
userUuids - List of users to checkLong getLastEventTimeForUser(String userUuid)
userUuid - user to checkMap<String,Long> getLastEventTimeForUsers(List<String> userUuids)
userUuids - users to checkString getServerConfigurationParameter(String key, String def)
key - key of propertydef - default valueboolean isUserMyWorkspace(String siteId)
siteId - id of siteboolean isUserAllowedInSite(String userId, String permission, String siteId)
userId - userId of user to check permissionpermission - the permission to check in sitesiteId - site idboolean checkForSite(String siteId)
siteId - int getMaxSearchResults()
int getMaxSearchResultsPerPage()
boolean isGravatarImageEnabledGlobally()
boolean isUserAllowedAddSite(String userUuid)
true if user allowed to create worksites, else false.Site addSite(String id, String type)
id - the id of the site.type - the type of the site e.g. project.null if there is a problem creating the site.boolean saveSite(Site site)
site - a reference to the site to save.true if successful, otherwise false.Site getSite(String siteId)
siteId - List<Site> getUserSites()
Tool getTool(String id)
id - the id of the tool required.null if a reference cannot be obtained.List<String> getToolsRequired(String category)
category - the type of site e.g. 'project'boolean isGoogleIntegrationEnabledGlobally()
Depending on this setting, the UI will allow a user to add their Google account. For institutions to use this there additional setup required.
boolean isLoggedIn()
boolean isProfileFieldsEnabled()
This setting controls the display of the profile fields.
boolean isProfileStatusEnabled()
This setting controls the display of the profile status section.
boolean isSocialProfileEnabled()
true if the profile2.profile.social.enabled flag is set, otherwise returns false.boolean isInterestsProfileEnabled()
true if the profile2.profile.interests.enabled flag is set, otherwise returns false.boolean isStaffProfileEnabled()
true if the profile2.profile.staff.enabled flag is set, otherwise returns false.boolean isStudentProfileEnabled()
true if the profile2.profile.student.enabled flag is set, otherwise returns false.boolean isNamePronunciationProfileEnabled()
true if the profile2.profile.name.pronunciation.enabled flag is set, otherwise returns false.boolean isProfileImageImportEnabled()
If enabled then at startup profile 2 will attempt to download any profile URLs set and upload them as profile images.
boolean isMenuEnabledGlobally()
If enabled, the profile sub-sections will be displayed. This setting controls the display of the profile sub-sections: * Messaging * Privacy * Gallery * Preferences * Search * Messaging * Connections
true if the profile2.menu.enabled flag is set, otherwise returns false.boolean isConnectionsEnabledGlobally()
If enabled, the connection feature will be available.
true if the profile2.connections.enabled flag is set, otherwise returns false.boolean isMessagingEnabledGlobally()
If enabled, the messaging feature will be enabled. Though, Messaging depends on Connections, thus if ConnectionsEnabled == false, Messaging will also be false.
boolean isSearchEnabledGlobally()
If enabled, the ability to search for people in profile will be available.
true if the profile2.search.enabled flag is set, otherwise returns false.boolean isPrivacyEnabledGlobally()
If enabled, the ability to modify one's privacy settings in profile will be available. Set profile2.privacy.default.x appropriately if disabled
true if the profile2.privacy.enabled flag is set, otherwise returns false.boolean isPreferenceEnabledGlobally()
If enabled, the ability to modify one's preferences within profile will be available.
true if the profile2.preference.enabled flag is set, otherwise returns false.boolean isMyKudosEnabledGlobally()
If enabled, the Kudos feature will be displayed.
true if the profile2.myKudos.enabled flag is set, otherwise returns false.boolean isOnlineStatusEnabledGlobally()
If enabled, an online indicator will be present when viewing a profile.
true if the profile2.onlineStatus.enabled flag is set, otherwise returns false.SiteService.SiteTitleValidationStatus validateSiteTitle(String orig, String stripped)
orig - the original, unaltered text as input by the userstripped - the HTML stripped textSiteService.SiteTitleValidationStatusString getNamePronunciationExamplesLink()
int getNamePronunciationDuration()
Copyright © 2003–2021 Sakai Project. All rights reserved.