org.sakaiproject.delegatedaccess.logic
Interface SakaiProxy


public interface SakaiProxy

An interface to abstract all Sakai related API calls in a central method that can be injected into our app.

Author:
Bryan Holladay (holladay@longsight.com)

Method Summary
 org.sakaiproject.authz.api.SecurityAdvisor addSiteUpdateSecurityAdvisor()
          Adds a security advisor to allow site.update
 void copyNewRole(String siteRef, String copyRealm, String copyRole, String newRole)
          Copy one role to another in an AuthzGroup
 List<org.sakaiproject.site.api.Site> getAllSites()
          returns all site's in Sakai
 List<org.sakaiproject.site.api.Site> getAllSitesByPages(Map<String,String> propsMap, int page, int pageMax, boolean orderByModifiedDate)
          returns all sites in Sakai, but uses a paging mechanism
 Set<org.sakaiproject.tool.api.Tool> getAllTools()
          returns all available tools in Sakai Map: ToolId -> Tool Name
 org.sakaiproject.authz.api.AuthzGroup getAuthzGroup(String siteRef)
          Remove this role from the authz group and update the group.
 org.sakaiproject.tool.api.Session getCurrentSession()
          returns the user's current session
 String getCurrentUserId()
          Get current user id
 Map<String,List<String>> getDelegatedAccessRealmOptions()
          Returns a list of realm/role options for the shopping period role first checks the sakai.property: delegatedaccess.realmoptions.delegatedaccess if not found, defaults to: all site realm templates that start with "!site."
 boolean getDisableShoppingTreeView()
          returns a sakai.property for delegatedaccess.disable.shopping.tree.view
 boolean getDisableUserTreeView()
          returns the setting for delegatedaccess.disable.user.tree.view
 String[] getHomeTools()
          returns sakai.properties setting of home tool ids delegatedaccess.hometools
 String getRootName()
          will return Sakai's name for the root of the hierarchy.
 String[] getServerConfigurationStrings(String property)
          Returns a list of Strings for the sakai.property
 Map<String,List<String>> getShoppingRealmOptions()
          Returns a list of realm/role options for the shopping period role first checks the sakai.property: delegatedaccess.realmoptions.shopping if not found, defaults to: all site realm templates that start with "!site."
 org.sakaiproject.site.api.Site getSiteById(String siteRef)
          Returns the site for that Id
 org.sakaiproject.site.api.Site getSiteByRef(String siteRef)
          Returns the site for the site ref
 List<org.sakaiproject.site.api.Site> getSites(org.sakaiproject.site.api.SiteService.SelectionType type, String search, Map<String,String> propsMap)
          Returns a list of sites based on the attributes sent in
 String getSkinRepoProperty()
          Wrapper for ServerConfigurationService.getString("skin.repo")
 String getTermField()
          returns the systems term field based on a sakai.property (delegatedaccess.termfield) default is term_eid
 List<String[]> getTerms()
          Returns a map (id, title) of terms either by the course management api or by the unique set of site propeties if you unset useCourseManagementApiForTerms
 String getToolSkinCSS(String skinRepo)
          Gets the tool skin CSS first by checking the tool, otherwise by using the default property.
 org.sakaiproject.user.api.User getUser(String id)
          returns a user for passed in userId
 Set<String> getUserMembershipForCurrentUser()
          returns a list of site references that the current user has access to
 boolean isShoppingPeriodInstructorEditable()
          returns true if delegatedaccess.shopping.instructorEditable is set to true, otherwise, false
 boolean isShoppingTool()
          returns true if this is the shopping period tool
 boolean isShowTermColumnAccess()
          default is true, otherwise looks up sakai.property delegatedaccess.showtermcolumn.access
 boolean isShowTermColumnShopping()
          default is true, otherwise looks up sakai.property delegatedaccess.showtermcolumn.shopping
 boolean isSuperUser()
          Is the current user a superUser? (anyone in admin realm)
 boolean isUserInstructor(String userId, String siteId)
          returns true only if the user is a member of the site and has site.upd permission
 boolean isUserMember(String userId, String siteRef)
          returns true if the user is a member of the site
 void popSecurityAdvisor(org.sakaiproject.authz.api.SecurityAdvisor advisor)
          pops the site.update security advisor
 void postEvent(String event, String reference, boolean modify)
          Post an event to Sakai
 void refreshCurrentUserAuthz()
          call authzGroupService.refreshUser for current user
 void removeRoleFromAuthzGroup(org.sakaiproject.authz.api.AuthzGroup group, org.sakaiproject.authz.api.Role role)
          Delete an AuthzGroup in Sakai
 void saveSite(org.sakaiproject.site.api.Site site)
          Save a Sakai site via the SiteService.
 List<org.sakaiproject.user.api.User> searchUsers(String search, int first, int last)
          user's Sakai userDirectoryService to search for users
 void sendEmail(String subject, String body)
          Sends an email
 boolean useCourseManagementApiForTerms()
          default is true if this is true, then the term options will be loaded from the CourseManagement API, otherwise, a distinct query will be ran against site properties based on the term field delegatedaccess.term.useCourseManagmentApi
 

Method Detail

getCurrentUserId

String getCurrentUserId()
Get current user id

Returns:

isSuperUser

boolean isSuperUser()
Is the current user a superUser? (anyone in admin realm)

Returns:

postEvent

void postEvent(String event,
               String reference,
               boolean modify)
Post an event to Sakai

Parameters:
event - name of event
reference - reference
modify - true if something changed, false if just access

getSkinRepoProperty

String getSkinRepoProperty()
Wrapper for ServerConfigurationService.getString("skin.repo")

Returns:

getToolSkinCSS

String getToolSkinCSS(String skinRepo)
Gets the tool skin CSS first by checking the tool, otherwise by using the default property.

Parameters:
the - location of the skin repo
Returns:

getCurrentSession

org.sakaiproject.tool.api.Session getCurrentSession()
returns the user's current session

Returns:

getAllSites

List<org.sakaiproject.site.api.Site> getAllSites()
returns all site's in Sakai

Returns:

getAllSitesByPages

List<org.sakaiproject.site.api.Site> getAllSitesByPages(Map<String,String> propsMap,
                                                        int page,
                                                        int pageMax,
                                                        boolean orderByModifiedDate)
returns all sites in Sakai, but uses a paging mechanism

Parameters:
propsMap - can be null or send over props to filter sites on
page - Page to start from (1 based)
pageMax - maximum number of sites per page
orderByModifiedDate -
Returns:

searchUsers

List<org.sakaiproject.user.api.User> searchUsers(String search,
                                                 int first,
                                                 int last)
user's Sakai userDirectoryService to search for users

Parameters:
search -
first -
last -
Returns:

getSiteByRef

org.sakaiproject.site.api.Site getSiteByRef(String siteRef)
Returns the site for the site ref

Parameters:
siteRef -
Returns:

getSiteById

org.sakaiproject.site.api.Site getSiteById(String siteRef)
Returns the site for that Id

Parameters:
siteRef -
Returns:

saveSite

void saveSite(org.sakaiproject.site.api.Site site)
Save a Sakai site via the SiteService.

Parameters:
site -

getRootName

String getRootName()
will return Sakai's name for the root of the hierarchy. Looks first for sakai.property: HIERARCHY_ROOT_TITLE_PROPERTY, then ui.service, then finally just defaults to the string "Sakai".

Returns:

getServerConfigurationStrings

String[] getServerConfigurationStrings(String property)
Returns a list of Strings for the sakai.property

Parameters:
property -
Returns:

getShoppingRealmOptions

Map<String,List<String>> getShoppingRealmOptions()
Returns a list of realm/role options for the shopping period role first checks the sakai.property: delegatedaccess.realmoptions.shopping if not found, defaults to: all site realm templates that start with "!site."

Returns:

getDelegatedAccessRealmOptions

Map<String,List<String>> getDelegatedAccessRealmOptions()
Returns a list of realm/role options for the shopping period role first checks the sakai.property: delegatedaccess.realmoptions.delegatedaccess if not found, defaults to: all site realm templates that start with "!site."

Returns:

refreshCurrentUserAuthz

void refreshCurrentUserAuthz()
call authzGroupService.refreshUser for current user


getAllTools

Set<org.sakaiproject.tool.api.Tool> getAllTools()
returns all available tools in Sakai Map: ToolId -> Tool Name

Returns:

getUserMembershipForCurrentUser

Set<String> getUserMembershipForCurrentUser()
returns a list of site references that the current user has access to

Returns:

getAuthzGroup

org.sakaiproject.authz.api.AuthzGroup getAuthzGroup(String siteRef)
Remove this role from the authz group and update the group.

Parameters:
siteRef -
role -
Returns:

removeRoleFromAuthzGroup

void removeRoleFromAuthzGroup(org.sakaiproject.authz.api.AuthzGroup group,
                              org.sakaiproject.authz.api.Role role)
Delete an AuthzGroup in Sakai

Parameters:
id -

copyNewRole

void copyNewRole(String siteRef,
                 String copyRealm,
                 String copyRole,
                 String newRole)
Copy one role to another in an AuthzGroup

Parameters:
siteRef -
copyRealm -
copyRole -
newRole -

addSiteUpdateSecurityAdvisor

org.sakaiproject.authz.api.SecurityAdvisor addSiteUpdateSecurityAdvisor()
Adds a security advisor to allow site.update

Returns:

popSecurityAdvisor

void popSecurityAdvisor(org.sakaiproject.authz.api.SecurityAdvisor advisor)
pops the site.update security advisor

Parameters:
advisor -

getSites

List<org.sakaiproject.site.api.Site> getSites(org.sakaiproject.site.api.SiteService.SelectionType type,
                                              String search,
                                              Map<String,String> propsMap)
Returns a list of sites based on the attributes sent in

Parameters:
type -
search -
propsMap -
Returns:

isShoppingTool

boolean isShoppingTool()
returns true if this is the shopping period tool

Returns:

getTermField

String getTermField()
returns the systems term field based on a sakai.property (delegatedaccess.termfield) default is term_eid

Returns:

getHomeTools

String[] getHomeTools()
returns sakai.properties setting of home tool ids delegatedaccess.hometools

Returns:

isShowTermColumnShopping

boolean isShowTermColumnShopping()
default is true, otherwise looks up sakai.property delegatedaccess.showtermcolumn.shopping

Returns:

isShowTermColumnAccess

boolean isShowTermColumnAccess()
default is true, otherwise looks up sakai.property delegatedaccess.showtermcolumn.access

Returns:

useCourseManagementApiForTerms

boolean useCourseManagementApiForTerms()
default is true if this is true, then the term options will be loaded from the CourseManagement API, otherwise, a distinct query will be ran against site properties based on the term field delegatedaccess.term.useCourseManagmentApi

Returns:

getTerms

List<String[]> getTerms()
Returns a map (id, title) of terms either by the course management api or by the unique set of site propeties if you unset useCourseManagementApiForTerms

Returns:

sendEmail

void sendEmail(String subject,
               String body)
Sends an email

Parameters:
subject -
body -

getDisableUserTreeView

boolean getDisableUserTreeView()
returns the setting for delegatedaccess.disable.user.tree.view

Returns:

getDisableShoppingTreeView

boolean getDisableShoppingTreeView()
returns a sakai.property for delegatedaccess.disable.shopping.tree.view

Returns:

getUser

org.sakaiproject.user.api.User getUser(String id)
returns a user for passed in userId

Parameters:
id -
Returns:

isUserInstructor

boolean isUserInstructor(String userId,
                         String siteId)
returns true only if the user is a member of the site and has site.upd permission

Parameters:
userId -
siteId -
Returns:

isShoppingPeriodInstructorEditable

boolean isShoppingPeriodInstructorEditable()
returns true if delegatedaccess.shopping.instructorEditable is set to true, otherwise, false

Returns:

isUserMember

boolean isUserMember(String userId,
                     String siteRef)
returns true if the user is a member of the site

Parameters:
userId -
siteRef -
Returns:


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