org.sakaiproject.delegatedaccess.dao.impl
Class DelegatedAccessDaoImpl

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.jdbc.core.support.JdbcDaoSupport
          extended by org.sakaiproject.delegatedaccess.dao.impl.DelegatedAccessDaoImpl
All Implemented Interfaces:
DelegatedAccessDao, org.springframework.beans.factory.InitializingBean

public class DelegatedAccessDaoImpl
extends org.springframework.jdbc.core.support.JdbcDaoSupport
implements DelegatedAccessDao


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
DelegatedAccessDaoImpl()
           
 
Method Summary
 void cleanupOrphanedPermissions()
          When a node is deleted or a hierarchy is destroyed, HierarchyService just orphans the permissions table data instead of deleting it.
 void copyRole(String fromRealm, String fromRole, String[] toRealm, String toRole)
           
 List<String> findActiveSites(String[] siteIds)
          DAC-40 Highlight Inactive Courses in site search requires the job "InactiveCoursesJob" attached in the jira
 List<String> getDelegatedAccessUsers()
          returns a list of user ids for users who have at least one of the following permissions in any node: site.visit, accessAdmin, or shoppingAdmin
 List<String> getDistinctSiteTerms(String termField)
           
 List<String> getEmptyNonSiteNodes(String hierarchyId)
           
 Map<String,Set<String>> getNodesAndPermsForUser(String userId, String[] nodeIds)
          returns a map of {nodeId -> {permission, permission...}) for the given user if a user doesn't have permissions for a node, it won't show up in the map
 Map<String,List<String>> getNodesBySiteRef(String[] siteRefs, String hierarchyId)
          returns a Map of -> {siteRef, {nodeId, nodeId ...}}
 String getSiteProperty(String propertyName, String siteId)
           
 List<String> getSitesWithDelegatedAccessTool(String[] siteIds)
          returns a list of site id which have have the Delegated Access tool
 void init()
          init
 void removeAnonAndAuthRoles(String[] siteRefs)
          Deletes the .anon and .auth roles for all sites
 void removeSiteProperty(String[] siteIds, String propertyName)
           
 List<String[]> searchSites(String titleSearch, Map<String,String> propsMap, String[] instructorIds, boolean publishedOnly)
          returns a list of {siteId, title} for sites returned in search if you search for instructorsIds as well, then the results will be {siteId, title, userId}
 Map<String,Map<String,String>> searchSitesForProp(String[] props, String[] siteIds)
          returns a list of {siteId, map{name->value}} for the site ids and properties searched
 void updateSiteProperty(String[] siteIds, String propertyName, String propertyValue)
           
 
Methods inherited from class org.springframework.jdbc.core.support.JdbcDaoSupport
checkDaoConfig, createJdbcTemplate, getConnection, getDataSource, getExceptionTranslator, getJdbcTemplate, initTemplateConfig, releaseConnection, setDataSource, setJdbcTemplate
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatedAccessDaoImpl

public DelegatedAccessDaoImpl()
Method Detail

init

public void init()
init


getDistinctSiteTerms

public List<String> getDistinctSiteTerms(String termField)
Specified by:
getDistinctSiteTerms in interface DelegatedAccessDao

getSiteProperty

public String getSiteProperty(String propertyName,
                              String siteId)
Specified by:
getSiteProperty in interface DelegatedAccessDao

getNodesBySiteRef

public Map<String,List<String>> getNodesBySiteRef(String[] siteRefs,
                                                  String hierarchyId)
Description copied from interface: DelegatedAccessDao
returns a Map of -> {siteRef, {nodeId, nodeId ...}}

Specified by:
getNodesBySiteRef in interface DelegatedAccessDao
Returns:

getEmptyNonSiteNodes

public List<String> getEmptyNonSiteNodes(String hierarchyId)
Specified by:
getEmptyNonSiteNodes in interface DelegatedAccessDao

updateSiteProperty

public void updateSiteProperty(String[] siteIds,
                               String propertyName,
                               String propertyValue)
Specified by:
updateSiteProperty in interface DelegatedAccessDao

removeSiteProperty

public void removeSiteProperty(String[] siteIds,
                               String propertyName)
Specified by:
removeSiteProperty in interface DelegatedAccessDao

searchSites

public List<String[]> searchSites(String titleSearch,
                                  Map<String,String> propsMap,
                                  String[] instructorIds,
                                  boolean publishedOnly)
Description copied from interface: DelegatedAccessDao
returns a list of {siteId, title} for sites returned in search if you search for instructorsIds as well, then the results will be {siteId, title, userId}

Specified by:
searchSites in interface DelegatedAccessDao
Returns:

searchSitesForProp

public Map<String,Map<String,String>> searchSitesForProp(String[] props,
                                                         String[] siteIds)
Description copied from interface: DelegatedAccessDao
returns a list of {siteId, map{name->value}} for the site ids and properties searched

Specified by:
searchSitesForProp in interface DelegatedAccessDao
Returns:

cleanupOrphanedPermissions

public void cleanupOrphanedPermissions()
Description copied from interface: DelegatedAccessDao
When a node is deleted or a hierarchy is destroyed, HierarchyService just orphans the permissions table data instead of deleting it. This is an issue in Shopping Period job since it destroys the Shopping Period Hierarchy every time its ran

Specified by:
cleanupOrphanedPermissions in interface DelegatedAccessDao

getNodesAndPermsForUser

public Map<String,Set<String>> getNodesAndPermsForUser(String userId,
                                                       String[] nodeIds)
Description copied from interface: DelegatedAccessDao
returns a map of {nodeId -> {permission, permission...}) for the given user if a user doesn't have permissions for a node, it won't show up in the map

Specified by:
getNodesAndPermsForUser in interface DelegatedAccessDao
Returns:

findActiveSites

public List<String> findActiveSites(String[] siteIds)
DAC-40 Highlight Inactive Courses in site search requires the job "InactiveCoursesJob" attached in the jira

Specified by:
findActiveSites in interface DelegatedAccessDao
Returns:

removeAnonAndAuthRoles

public void removeAnonAndAuthRoles(String[] siteRefs)
Description copied from interface: DelegatedAccessDao
Deletes the .anon and .auth roles for all sites

Specified by:
removeAnonAndAuthRoles in interface DelegatedAccessDao

copyRole

public void copyRole(String fromRealm,
                     String fromRole,
                     String[] toRealm,
                     String toRole)
Specified by:
copyRole in interface DelegatedAccessDao

getDelegatedAccessUsers

public List<String> getDelegatedAccessUsers()
Description copied from interface: DelegatedAccessDao
returns a list of user ids for users who have at least one of the following permissions in any node: site.visit, accessAdmin, or shoppingAdmin

Specified by:
getDelegatedAccessUsers in interface DelegatedAccessDao
Returns:

getSitesWithDelegatedAccessTool

public List<String> getSitesWithDelegatedAccessTool(String[] siteIds)
Description copied from interface: DelegatedAccessDao
returns a list of site id which have have the Delegated Access tool

Specified by:
getSitesWithDelegatedAccessTool in interface DelegatedAccessDao
Returns:


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