org.sakaiproject.tool.assessment.facade
Interface QuestionPoolFacadeQueriesAPI

All Known Implementing Classes:
QuestionPoolFacadeQueries

public interface QuestionPoolFacadeQueriesAPI


Method Summary
 Long add()
           
 void addItemsToSection(Collection ids, long sectionId)
          DOCUMENTATION PENDING
 void addItemToPool(QuestionPoolItemData qpi)
          add a question to a pool
 void copyPool(Tree tree, String agentId, Long sourceId, Long destId)
          Copy a pool to a new location.
 void deletePool(Long poolId, String agent, Tree tree)
          Delete pool and questions attached to it plus any subpool under it
 List getAllItemFacades(Long questionPoolId)
           
 List getAllItemFacadesOrderByItemText(Long questionPoolId, String orderBy)
           
 List getAllItemFacadesOrderByItemType(Long questionPoolId, String orderBy)
           
 List getAllItems(Long questionPoolId)
           
 List getAllPools()
          Get a list of all the pools in the site.
 QuestionPoolIteratorFacade getAllPools(String agentId)
          Get all the pools that the agent has access to.
 ArrayList getBasicInfoOfAllPools(String agentId)
           
 ItemFacade getItem(String id)
          This method returns an ItemFacade that we can use to construct our ItemImpl
 QuestionPoolFacade getPool(Long poolId, String agent)
          Get a pool based on poolId.
 QuestionPoolFacade getPoolById(Long questionPoolId)
           
 List getPoolIdsByAgent(String agentId)
          Return a list of questionPoolId (java.lang.Long)
 List getPoolIdsByItem(String itemId)
          Return a list of questionPoolId (java.lang.Long)
 QuestionPoolAccessData getQuestionPoolAccessData(Long poolId, String agentId)
           
 IdImpl getQuestionPoolId(long id)
           
 IdImpl getQuestionPoolId(Long id)
           
 IdImpl getQuestionPoolId(String id)
           
 HashMap getQuestionPoolItemMap()
           
 List getSubPools(Long poolId)
          Get all the children pools of a pool.
 int getSubPoolSize(Long poolId)
           
 boolean hasSubPools(Long poolId)
          DOCUMENTATION PENDING
 boolean isDescendantOf(QuestionPoolFacade destPool, QuestionPoolFacade sourcePool)
          Is destination a descendant of the source?
 void moveItemToPool(String itemId, Long sourceId, Long destId)
          DOCUMENTATION PENDING
 void movePool(String agentId, Long sourcePoolId, Long destPoolId)
          Move pool under another pool.
 boolean poolIsUnique(Long questionPoolId, String title, Long parentPoolId)
           
 void removeItemFromPool(String itemId, Long poolId)
          DOCUMENTATION PENDING
 QuestionPoolFacade savePool(QuestionPoolFacade pool)
          DOCUMENTATION PENDING
 void setPoolAccessType(QuestionPoolData qpp, String agentId)
           
 

Method Detail

getQuestionPoolId

public IdImpl getQuestionPoolId(String id)

getQuestionPoolId

public IdImpl getQuestionPoolId(Long id)

getQuestionPoolId

public IdImpl getQuestionPoolId(long id)

getAllPools

public List getAllPools()
Get a list of all the pools in the site. Note that questions in each pool will not be populated. We must keep this list updated.


getAllPools

public QuestionPoolIteratorFacade getAllPools(String agentId)
Get all the pools that the agent has access to. The easiest way seems to be #1. get all the existing pool #2. get all the QuestionPoolAccessData record of the agent #3. go through the existing pools and check it against the QuestionPoolAccessData (qpa) record to see if the agent is granted access to it. qpa record (if exists) always trumps the default access right set up for a pool e.g. if the defaultAccessType for a pool is ACCESS_DENIED but the qpa record say ADMIN, then access=ADMIN e.g. if the defaultAccessType for a pool is ADMIN but the qpa record say ACCESS_DENIED, then access=ACCESS_DENIED e.g. if no qpa record exists, then access rule will follow the defaultAccessType set by the pool


getBasicInfoOfAllPools

public ArrayList getBasicInfoOfAllPools(String agentId)

poolIsUnique

public boolean poolIsUnique(Long questionPoolId,
                            String title,
                            Long parentPoolId)

getAllItems

public List getAllItems(Long questionPoolId)

getAllItemFacadesOrderByItemText

public List getAllItemFacadesOrderByItemText(Long questionPoolId,
                                             String orderBy)

getAllItemFacadesOrderByItemType

public List getAllItemFacadesOrderByItemType(Long questionPoolId,
                                             String orderBy)

getAllItemFacades

public List getAllItemFacades(Long questionPoolId)

getItem

public ItemFacade getItem(String id)
This method returns an ItemFacade that we can use to construct our ItemImpl


getPool

public QuestionPoolFacade getPool(Long poolId,
                                  String agent)
Get a pool based on poolId. I am not sure why agent is not used though is being parsed.

Parameters:
agent - DOCUMENTATION PENDING
Returns:
DOCUMENTATION PENDING

setPoolAccessType

public void setPoolAccessType(QuestionPoolData qpp,
                              String agentId)

getQuestionPoolAccessData

public QuestionPoolAccessData getQuestionPoolAccessData(Long poolId,
                                                        String agentId)

addItemsToSection

public void addItemsToSection(Collection ids,
                              long sectionId)
DOCUMENTATION PENDING

Parameters:
ids - DOCUMENTATION PENDING
sectionId - DOCUMENTATION PENDING

addItemToPool

public void addItemToPool(QuestionPoolItemData qpi)
add a question to a pool


deletePool

public void deletePool(Long poolId,
                       String agent,
                       Tree tree)
Delete pool and questions attached to it plus any subpool under it

Parameters:
poolId - DOCUMENTATION PENDING

movePool

public void movePool(String agentId,
                     Long sourcePoolId,
                     Long destPoolId)
Move pool under another pool. The dest pool must not be the descendant of the source nor can they be the same pool .


isDescendantOf

public boolean isDescendantOf(QuestionPoolFacade destPool,
                              QuestionPoolFacade sourcePool)
Is destination a descendant of the source?


removeItemFromPool

public void removeItemFromPool(String itemId,
                               Long poolId)
DOCUMENTATION PENDING

Parameters:
itemId - DOCUMENTATION PENDING
poolId - DOCUMENTATION PENDING

moveItemToPool

public void moveItemToPool(String itemId,
                           Long sourceId,
                           Long destId)
DOCUMENTATION PENDING

Parameters:
itemId - DOCUMENTATION PENDING

savePool

public QuestionPoolFacade savePool(QuestionPoolFacade pool)
DOCUMENTATION PENDING

Parameters:
pool - DOCUMENTATION PENDING

getSubPools

public List getSubPools(Long poolId)
Get all the children pools of a pool. Return a list of QuestionPoolData should return QuestionPool instead - need fixing, daisyf

Parameters:
poolId - DOCUMENTATION PENDING

getSubPoolSize

public int getSubPoolSize(Long poolId)

hasSubPools

public boolean hasSubPools(Long poolId)
DOCUMENTATION PENDING

Parameters:
poolId - DOCUMENTATION PENDING

getPoolIdsByAgent

public List getPoolIdsByAgent(String agentId)
Return a list of questionPoolId (java.lang.Long)


getPoolIdsByItem

public List getPoolIdsByItem(String itemId)
Return a list of questionPoolId (java.lang.Long)

Parameters:
itemId - DOCUMENTATION PENDING

copyPool

public void copyPool(Tree tree,
                     String agentId,
                     Long sourceId,
                     Long destId)
Copy a pool to a new location.


add

public Long add()

getPoolById

public QuestionPoolFacade getPoolById(Long questionPoolId)

getQuestionPoolItemMap

public HashMap getQuestionPoolItemMap()