org.sakaiproject.poll.logic
Interface ExternalLogic


public interface ExternalLogic


Method Summary
 String getCurrentLocationId()
           
 String getCurrentLocationReference()
           
 org.sakaiproject.tool.api.ToolSession getCurrentToolSession()
          Needed to invoke helper tools
 String getCurrentUserId()
           
 String getCurrentuserReference()
          Get the current user reference (/user/admin)
 TimeZone getLocalTimeZone()
          get the correct Timezone for the the current user
 List<String> getPermissionKeys()
          Get a list of the permission keys for the tool
 List<String> getRoleIdsInRealm(String realmId)
          Get a list of RoleIds in a the given realms
 Map<String,PollRolePerms> getRoles(String locationReference)
          Get the Roles in a site
 String getSiteRefFromId(String siteId)
          Get a site reference "/site/ABCD from its id (ABCD)
 List<String> getSitesForUser(String userId, String permission)
          Get the sites users is a member of
 String getSiteTile(String siteId)
           
 String getUserEidFromId(String userId)
          Given a userId, return the associated userEid
 boolean isAllowedInLocation(String permission, String locationReference)
          is the current user allowed to perform the action in the current location?
 boolean isAllowedInLocation(String permission, String locationReference, String userRefence)
          is the current user allowed to perform the action in the current location?
 boolean isMobileBrowser()
          Is the current user using a mobile browser?
 boolean isResultsChartEnabled()
          Are charts enabled on the results page?
 boolean isRoleAllowedInRealm(String roleId, String realmId, String permission)
          is the role allowed to perform the function in the given realm?
 boolean isUserAdmin()
          Check if the current user has super admin access
 boolean isUserAdmin(String userId)
          Check if this user has super admin access
 void notifyDeletedOption(List<String> userEids, String siteTitle, String pollQuestion)
          Notify a list of users that an option they voted for in a poll has been deleted.
 void postEvent(String eventId, String reference, boolean modify)
          Post a new event to the event tracking service
 void registerFunction(String function)
          Register a function with the Sakai Function manager
 void setToolPermissions(Map<String,PollRolePerms> permMap, String locationReference)
          Set the tool permissions for the given location
 boolean userIsViewingAsRole()
          is the user using the "view as ..." feature
 

Method Detail

isUserAdmin

boolean isUserAdmin(String userId)
Check if this user has super admin access

Parameters:
userId - the internal user id (not username)
Returns:
true if the user has admin access, false otherwise

isUserAdmin

boolean isUserAdmin()
Check if the current user has super admin access

Parameters:
userId - the internal user id (not username)
Returns:
true if the user has admin access, false otherwise

getCurrentLocationId

String getCurrentLocationId()
Returns:
the current location id of the current user

getCurrentLocationReference

String getCurrentLocationReference()
Returns:
the current location reference of the current user

getCurrentUserId

String getCurrentUserId()
Returns:
the current sakai user id (not username)

getCurrentuserReference

String getCurrentuserReference()
Get the current user reference (/user/admin)

Returns:

getUserEidFromId

String getUserEidFromId(String userId)
Given a userId, return the associated userEid

Parameters:
userId - The userId
Returns:
The userEid

isAllowedInLocation

boolean isAllowedInLocation(String permission,
                            String locationReference)
is the current user allowed to perform the action in the current location?

Parameters:
permission -
locationReference -

isAllowedInLocation

boolean isAllowedInLocation(String permission,
                            String locationReference,
                            String userRefence)
is the current user allowed to perform the action in the current location?

Parameters:
permission -
locationReference -
the - user

getSitesForUser

List<String> getSitesForUser(String userId,
                             String permission)
Get the sites users is a member of

Parameters:
userId -
permission -
Returns:
a list of site references

postEvent

void postEvent(String eventId,
               String reference,
               boolean modify)
Post a new event to the event tracking service

Parameters:
eventId -
reference -
does - the event modify state?

registerFunction

void registerFunction(String function)
Register a function with the Sakai Function manager

Parameters:
function -

getLocalTimeZone

TimeZone getLocalTimeZone()
get the correct Timezone for the the current user

Returns:

getRoleIdsInRealm

List<String> getRoleIdsInRealm(String realmId)
Get a list of RoleIds in a the given realms

Parameters:
RealmId -
Returns:
a list os frings of the role Ids

isRoleAllowedInRealm

boolean isRoleAllowedInRealm(String roleId,
                             String realmId,
                             String permission)
is the role allowed to perform the function in the given realm?

Parameters:
RoleId -
realmId -
Returns:

getSiteTile

String getSiteTile(String siteId)
Parameters:
siteId -
Returns:

getSiteRefFromId

String getSiteRefFromId(String siteId)
Get a site reference "/site/ABCD from its id (ABCD)

Parameters:
siteId -
Returns:

setToolPermissions

void setToolPermissions(Map<String,PollRolePerms> permMap,
                        String locationReference)
                        throws SecurityException,
                               IllegalArgumentException
Set the tool permissions for the given location

Parameters:
permMap -
locationReference -
Throws:
SecurityException
IllegalArgumentException

getRoles

Map<String,PollRolePerms> getRoles(String locationReference)
Get the Roles in a site

Parameters:
locationReference -
Returns:

userIsViewingAsRole

boolean userIsViewingAsRole()
is the user using the "view as ..." feature

Returns:

notifyDeletedOption

void notifyDeletedOption(List<String> userEids,
                         String siteTitle,
                         String pollQuestion)
Notify a list of users that an option they voted for in a poll has been deleted.

Parameters:
userEids - A List of user EID's that identify the users to be notified
pollQuestion - The text of the poll whose option was deleted
siteTitle - The title of the site that owns the option's poll

getCurrentToolSession

org.sakaiproject.tool.api.ToolSession getCurrentToolSession()
Needed to invoke helper tools


isResultsChartEnabled

boolean isResultsChartEnabled()
Are charts enabled on the results page? poll.results.chart.enabled=true|false, default false

Returns:

isMobileBrowser

boolean isMobileBrowser()
Is the current user using a mobile browser?

Returns:

getPermissionKeys

List<String> getPermissionKeys()
Get a list of the permission keys for the tool

Returns:


Copyright © 2003-2012 Sakai Project. All Rights Reserved.