001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sam/trunk/component/src/java/org/sakaiproject/tool/assessment/facade/QuestionPoolFacadeQueriesAPI.java $
003: * $Id: QuestionPoolFacadeQueriesAPI.java 9343 2006-05-12 23:30:02Z lydial@stanford.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the"License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.tool.assessment.facade;
021:
022: import java.util.ArrayList;
023: import java.util.Collection;
024: import java.util.HashMap;
025: import java.util.List;
026:
027: import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemDataIfc;
028: import org.sakaiproject.tool.assessment.data.model.Tree;
029: import org.sakaiproject.tool.assessment.data.dao.questionpool.QuestionPoolAccessData;
030: import org.sakaiproject.tool.assessment.data.dao.questionpool.QuestionPoolData;
031: import org.sakaiproject.tool.assessment.data.dao.questionpool.QuestionPoolItemData;
032: import org.sakaiproject.tool.assessment.osid.shared.impl.IdImpl;
033:
034: public interface QuestionPoolFacadeQueriesAPI {
035:
036: public IdImpl getQuestionPoolId(String id);
037:
038: public IdImpl getQuestionPoolId(Long id);
039:
040: public IdImpl getQuestionPoolId(long id);
041:
042: /**
043: * Get a list of all the pools in the site. Note that questions in each pool will not
044: * be populated. We must keep this list updated.
045: */
046: public List getAllPools();
047:
048: /**
049: * Get all the pools that the agent has access to. The easiest way seems to be
050: * #1. get all the existing pool
051: * #2. get all the QuestionPoolAccessData record of the agent
052: * #3. go through the existing pools and check it against the QuestionPoolAccessData (qpa) record to see if
053: * the agent is granted access to it. qpa record (if exists) always trumps the default access right set
054: * up for a pool
055: * e.g. if the defaultAccessType for a pool is ACCESS_DENIED but the qpa record say ADMIN, then access=ADMIN
056: * e.g. if the defaultAccessType for a pool is ADMIN but the qpa record say ACCESS_DENIED, then access=ACCESS_DENIED
057: * e.g. if no qpa record exists, then access rule will follow the defaultAccessType set by the pool
058: */
059: public QuestionPoolIteratorFacade getAllPools(String agentId);
060:
061: public ArrayList getBasicInfoOfAllPools(String agentId);
062:
063: public boolean poolIsUnique(Long questionPoolId, String title,
064: Long parentPoolId, String agentId);
065:
066: public List getAllItems(Long questionPoolId);
067:
068: public List getAllItemFacadesOrderByItemText(Long questionPoolId,
069: String orderBy, String ascending);
070:
071: public List getAllItemFacadesOrderByItemType(Long questionPoolId,
072: String orderBy, String ascending);
073:
074: public List getAllItemFacades(Long questionPoolId);
075:
076: /**
077: * This method returns an ItemFacade that we can use to construct our ItemImpl
078: */
079: public ItemFacade getItem(String id);
080:
081: /**
082: * Get a pool based on poolId. I am not sure why agent is not used though is being parsed.
083: *
084: * @param poolid DOCUMENTATION PENDING
085: * @param agent DOCUMENTATION PENDING
086: *
087: * @return DOCUMENTATION PENDING
088: */
089: public QuestionPoolFacade getPool(Long poolId, String agent);
090:
091: public void setPoolAccessType(QuestionPoolData qpp, String agentId);
092:
093: public QuestionPoolAccessData getQuestionPoolAccessData(
094: Long poolId, String agentId);
095:
096: /**
097: * DOCUMENTATION PENDING
098: *
099: * @param ids DOCUMENTATION PENDING
100: * @param sectionId DOCUMENTATION PENDING
101: */
102: public void addItemsToSection(Collection ids, long sectionId);
103:
104: /**
105: * add a question to a pool
106: *
107: * @param itemId DOCUMENTATION PENDING
108: * @param poolId DOCUMENTATION PENDING
109: */
110: public void addItemToPool(QuestionPoolItemData qpi);
111:
112: /**
113: * Delete pool and questions attached to it plus any subpool under it
114: *
115: * @param itemId DOCUMENTATION PENDING
116: * @param poolId DOCUMENTATION PENDING
117: */
118: public void deletePool(Long poolId, String agent, Tree tree);
119:
120: /**
121: * Move pool under another pool. The dest pool must not be the
122: * descendant of the source nor can they be the same pool .
123: */
124: public void movePool(String agentId, Long sourcePoolId,
125: Long destPoolId);
126:
127: /**
128: * Is destination a descendant of the source?
129: */
130: public boolean isDescendantOf(QuestionPoolFacade destPool,
131: QuestionPoolFacade sourcePool);
132:
133: /**
134: * DOCUMENTATION PENDING
135: *
136: * @param itemId DOCUMENTATION PENDING
137: * @param poolId DOCUMENTATION PENDING
138: */
139: public void removeItemFromPool(String itemId, Long poolId);
140:
141: /**
142: * DOCUMENTATION PENDING
143: *
144: * @param itemId DOCUMENTATION PENDING
145: * @param poolId DOCUMENTATION PENDING
146: */
147: public void moveItemToPool(String itemId, Long sourceId, Long destId);
148:
149: /**
150: * DOCUMENTATION PENDING
151: *
152: * @param pool DOCUMENTATION PENDING
153: */
154: public QuestionPoolFacade savePool(QuestionPoolFacade pool);
155:
156: /**
157: * Get all the children pools of a pool. Return a list of QuestionPoolData
158: * should return QuestionPool instead - need fixing, daisyf
159: *
160: * @param itemId DOCUMENTATION PENDING
161: * @param poolId DOCUMENTATION PENDING
162: */
163:
164: public List getSubPools(Long poolId);
165:
166: public int getSubPoolSize(Long poolId);
167:
168: /**
169: * DOCUMENTATION PENDING
170: *
171: * @param itemId DOCUMENTATION PENDING
172: * @param poolId DOCUMENTATION PENDING
173: */
174:
175: public boolean hasSubPools(Long poolId);
176:
177: /**
178: * Return a list of questionPoolId (java.lang.Long)
179: *
180: * @param itemId DOCUMENTATION PENDING
181: * @param poolId DOCUMENTATION PENDING
182: */
183:
184: public List getPoolIdsByAgent(String agentId);
185:
186: /**
187: * Return a list of questionPoolId (java.lang.Long)
188: *
189: * @param itemId DOCUMENTATION PENDING
190: * @param poolId DOCUMENTATION PENDING
191: */
192:
193: public List getPoolIdsByItem(String itemId);
194:
195: /**
196: * Copy a pool to a new location.
197: */
198: public void copyPool(Tree tree, String agentId, Long sourceId,
199: Long destId, String prependString1, String prependString2);
200:
201: public Long add();
202:
203: public QuestionPoolFacade getPoolById(Long questionPoolId);
204:
205: public HashMap getQuestionPoolItemMap();
206:
207: public Long copyItemFacade(ItemDataIfc itemData);
208: }
|